jQuery(function(){ // group gallery items jQuery('div.fancy-gallery a') .each(function(){ var $this = jQuery(this); $this.attr('rel', $this.parents('.fancy-gallery').attr('id')); }); // Add Fancy Classes to single items: jQuery('a').each(function(){ // filter items if ( this.href.substr(this.href.length-4).toLowerCase().indexOf('.jpg') < 0="" &&="" this.href.substr(this.href.length-5).tolowercase().indexof('.jpeg')="">< 0="" &&="" this.href.substr(this.href.length-4).tolowercase().indexof('.png')="">< 0="" &&="" this.href.substr(this.href.length-4).tolowercase().indexof('.gif')="">< 0="" &&="" this.href.substr(this.href.length-4).tolowercase().indexof('.bmp')="">< 0="" &&="" this.href.substr(this.href.length-5).tolowercase().indexof('.wbmp')="">< 0="" &&="" this.href.substr(this.href.length-4).tolowercase().indexof('.ico')="">< 0 && true ) return; // shorter access path var $lnk = jquery(this); var $img = $lnk.find('img'); // add the fancybox class $lnk.addclass('fancybox'); // associate single images if ($lnk.attr('rel') == '' || $lnk.attr('rel') == undefined) $lnk.attr('rel', 'single-image'); // copy the title tag from link to img if ($lnk.attr('title') == '' || $lnk.attr('title') == undefined) $lnk.attr('title', $img.attr('title')); }); jquery('a.fancybox') .unbind('click') .fancybox({ padding : 10, cyclic : false, scrolling : 'auto', centeronscroll : false, overlayopacity : 0.90, overlaycolor : '#000000', titleshow : true, titleposition : 'inside', transitionin : 'fade', transitionout : 'fade', speedin : 300, speedout : 300, changespeed : 300, showclosebutton : false }); jquery('a.fancyframe') .unbind('click') .fancybox({ padding : 10, cyclic : false, scrolling : 'auto', centeronscroll : false, overlayopacity : 0.90, overlaycolor : '#000000', speedin : 300, speedout : 300, showclosebutton : false, height : '75%', width : '75%', type : 'iframe' }); }); 0="" &&="" true="" )="" return;="" shorter="" access="" path="" var="" $lnk="jQuery(this);" var="" $img="$lnk.find('img');" add="" the="" fancybox="" class="" $lnk.addclass('fancybox');="" associate="" single="" images="" if="" ($lnk.attr('rel')="=" ''="" ||="" $lnk.attr('rel')="=" undefined)="" $lnk.attr('rel',="" 'single-image');="" copy="" the="" title="" tag="" from="" link="" to="" img="" if="" ($lnk.attr('title')="=" ''="" ||="" $lnk.attr('title')="=" undefined)="" $lnk.attr('title',="" $img.attr('title'));="" });="" jquery('a.fancybox')="" .unbind('click')="" .fancybox({="" padding="" :="" 10,="" cyclic="" :="" false,="" scrolling="" :="" 'auto',="" centeronscroll="" :="" false,="" overlayopacity="" :="" 0.90,="" overlaycolor="" :="" '#000000',="" titleshow="" :="" true,="" titleposition="" :="" 'inside',="" transitionin="" :="" 'fade',="" transitionout="" :="" 'fade',="" speedin="" :="" 300,="" speedout="" :="" 300,="" changespeed="" :="" 300,="" showclosebutton="" :="" false="" });="" jquery('a.fancyframe')="" .unbind('click')="" .fancybox({="" padding="" :="" 10,="" cyclic="" :="" false,="" scrolling="" :="" 'auto',="" centeronscroll="" :="" false,="" overlayopacity="" :="" 0.90,="" overlaycolor="" :="" '#000000',="" speedin="" :="" 300,="" speedout="" :="" 300,="" showclosebutton="" :="" false,="" height="" :="" '75%',="" width="" :="" '75%',="" type="" :="" 'iframe'="" });="">