var fadeSlideShow_descpanel={ controls: [['wp-content/plugins/superb-slideshow/inc/x.png',7,7], ['wp-content/plugins/superb-slideshow/inc/restore.png',10,11], ['wp-content/plugins/superb-slideshow/inc/loading.gif',54,55]], //full URL and dimensions of close, restore, and loading images fontStyle: 'normal 11px Verdana', //font style for text descriptions slidespeed: 200 //speed of description panel animation (in millisec) } //No need to edit beyond here... jQuery.noConflict() function sswldSlideShow(settingarg){ this.setting=settingarg settingarg=null var setting=this.setting setting.sswld_fadeduration=setting.sswld_fadeduration? parseInt(setting.sswld_fadeduration) : 500 setting.curimage=(setting.sswld_persist)? sswldSlideShow.routines.getCookie("gallery-"+setting.sswld_wrapperid) : 0 setting.curimage=setting.curimage || 0 //account for curimage being null if cookie is empty setting.currentstep=0 //keep track of # of slides slideshow has gone through (applicable in sswld_displaymode='auto' only) setting.totalsteps=setting.sswld_imagearray.length*(setting.sswld_displaymode.cycles>0? setting.sswld_displaymode.cycles : Infinity) //Total steps limit (applicable in sswld_displaymode='auto' only w/ cycles>0) setting.fglayer=0, setting.bglayer=1 //index of active and background layer (switches after each change of slide) setting.oninit=setting.oninit || function(){} setting.onslide=setting.onslide || function(){} var preloadimages=[] //preload images setting.longestdesc="" //get longest description of all slides. If no desciptions defined, variable contains "" for (var isswld=0; isswldsetting.longestdesc.length) setting.longestdesc=setting.sswld_imagearray[isswld][3] } var closebutt=fadeSlideShow_descpanel.controls[0] //add close button to "desc" panel if sswld_descreveal="always" setting.closebutton=(setting.sswld_descreveal=="always")? '' : '' var slideshow=this jQuery(document).ready(function($){ //fire on DOM ready var setting=slideshow.setting var fullhtml=sswldSlideShow.routines.getFullHTML(setting.sswld_imagearray) //get full HTML of entire slideshow setting.$wrapperdiv=$('#'+setting.sswld_wrapperid).css({position:'relative', visibility:'visible', background:'black', overflow:'hidden', width:setting.sswld_dimensions[0], height:setting.sswld_dimensions[1]}).empty() //main slideshow DIV if (setting.$wrapperdiv.length==0){ //if no wrapper DIV found alert("Error: DIV with ID \""+setting.sswld_wrapperid+"\" not found on page.") return } setting.$gallerylayers=$('
') //two stacked DIVs to display the actual slide .css({position:'absolute', left:0, top:0, width:'100%', height:'100%', background:'black'}) .appendTo(setting.$wrapperdiv) var $loadingimg=$('') .css({left:setting.sswld_dimensions[0]/2-fadeSlideShow_descpanel.controls[2][1]/2, top:setting.sswld_dimensions[1]/2-fadeSlideShow_descpanel.controls[2][2]}) //center loading gif .appendTo(setting.$wrapperdiv) var $curimage=setting.$gallerylayers.html(fullhtml).find('img').hide().eq(setting.curimage) //prefill both layers with entire slideshow content, hide all images, and return current image if (setting.longestdesc!=""){ //if at least one slide contains a description (feature is enabled) sswldSlideShow.routines.adddescpanel($, setting) if (setting.sswld_descreveal=="always"){ //position desc panel so it's visible to begin with setting.$descpanel.css({top:setting.sswld_dimensions[1]-setting.panelheight}) setting.$descinner.click(function(e){ //asign click behavior to "close" icon if (e.target.className=="close"){ slideshow.showhidedescpanel('hide') } }) setting.$restorebutton.click(function(e){ //asign click behavior to "restore" icon slideshow.showhidedescpanel('show') $(this).css({visibility:'hidden'}) }) } else{ //display desc panel on demand (mouseover) setting.$wrapperdiv.bind('mouseenter', function(){slideshow.showhidedescpanel('show')}) setting.$wrapperdiv.bind('mouseleave', function(){slideshow.showhidedescpanel('hide')}) } } setting.$wrapperdiv.bind('mouseenter', function(){setting.ismouseover=true}) //pause slideshow mouseover setting.$wrapperdiv.bind('mouseleave', function(){setting.ismouseover=false}) if ($curimage.get(0).complete){ //accounf for IE not firing image.onload $loadingimg.hide() slideshow.paginateinit($) slideshow.showslide(setting.curimage) } else{ //initialize slideshow when first image has fully loaded $loadingimg.hide() slideshow.paginateinit($) $curimage.bind('load', function(){slideshow.showslide(setting.curimage)}) } setting.oninit.call(slideshow) //trigger oninit() event $(window).bind('unload', function(){ //clean up and sswld_persist if (slideshow.setting.sswld_persist) //remember last shown image's index sswldSlideShow.routines.setCookie("gallery-"+setting.sswld_wrapperid, setting.curimage) jQuery.each(slideshow.setting, function(k){ if (slideshow.setting[k] instanceof Array){ for (var i=0; i0? setting.curimage-1 : totalimages-1) : Math.min(keyword, totalimages-1) var $slideimage=setting.$gallerylayers.eq(setting.bglayer).find('img').hide().eq(imgindex).show() //hide all images except current one var imgdimensions=[$slideimage.width(), $slideimage.height()] //center align image $slideimage.css({marginLeft: (imgdimensions[0]>0 && imgdimensions[0]0 && imgdimensions[1]\n' : '' //hyperlink slide? layerHTML+='\n' layerHTML+=(imgelement[1])? '\n' : '' return layerHTML //return HTML for this layer }, getFullHTML:function(sswld_imagearray){ var preloadhtml='' for (var i=0; i') .css({position:'absolute', visibility:'hidden', width:'100%', left:0, top:setting.sswld_dimensions[1], font:fadeSlideShow_descpanel.fontStyle, zIndex:'1001'}) .appendTo(setting.$wrapperdiv) $('
') //create inner nav panel DIVs .css({position:'absolute', left:0, top:0, width:setting.$descpanel.width()-8, padding:'4px'}) .eq(0).css({background:'black', opacity:0.7}).end() //"descpanelbg" div .eq(1).css({color:'white'}).html(setting.closebutton + setting.longestdesc).end() //"descpanelfg" div .appendTo(setting.$descpanel) setting.$descinner=setting.$descpanel.find('div.descpanelfg') setting.panelheight=setting.$descinner.outerHeight() setting.$descpanel.css({height:setting.panelheight}).find('div').css({height:'100%'}) if (setting.sswld_descreveal=="always"){ //create restore button setting.$restorebutton=$('') .appendTo(setting.$wrapperdiv) } }, getCookie:function(Name){ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair if (document.cookie.match(re)) //if cookie found return document.cookie.match(re)[0].split("=")[1] //return its value return null }, setCookie:function(name, value){ document.cookie = name+"=" + value + ";path=/" } }