PDA

View Full Version : Two Simple Gallery Queries



clpix
01-19-2012, 02:27 PM
1) Script Title: SimpleGallery

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...plegallery.htm

3) Describe problem:

Thanks to John Scheuer's amazing attention to this forum (and his superb solutions), I have added a background color to simplegallery in a site on which I'm working. It works in IE, FF, Chrome, and Safari. I also switched to simplegallery_iefix.js (http://www.betsylittle.com/scripts/simplegallery_iefix.js). However, in IE—an instant before simplegallery loads—I briefly see the word "null" appear, which wrecks the effect. First question: can that be resolved?

Second question: How does one delete the 1/x number of slides slug at the bottom of the slide show?

The site-under-construction is www.betsylittle.com (http://www.betsylittle.com/BLREPHP.php)

Many thanks in advance for any help, Christopher

jscheuer1
01-20-2012, 02:34 AM
Second question first. Put this stylesheet in the head of the page:


<style type="text/css">
.gallerystatus {
display: none !important;
}

Or incorporate its rule into an existing stylesheet for the page.

First question - Replace the showslide function in simplegallery_iefix.js with this one:


showslide:function(keyword){
var slideshow=this
var setting=slideshow.setting
var totalimages=setting.imagearray.length
var imgindex=(keyword=="next")? (setting.curimage<totalimages-1? setting.curimage+1 : 0)
: (keyword=="prev")? (setting.curimage>0? setting.curimage-1 : totalimages-1)
: Math.min(keyword, totalimages-1)
setting.gallerylayers[setting.bglayer].innerHTML=simpleGallery.routines.getSlideHTML(setting.imagearray[imgindex])
setting.$gallerylayers.eq(setting.bglayer).css({zIndex:1000, opacity:0}) //background layer becomes foreground
.stop().css({opacity:0}).animate({opacity:1}, setting.fadeduration, function(){ //Callback function after fade animation is complete:
clearTimeout(setting.playtimer)
setting.gallerylayers[setting.bglayer].innerHTML=''; //empty bglayer (previously fglayer before setting.fglayer=setting.bglayer was set below)
try{
setting.onslide.call(slideshow, setting.gallerylayers[setting.fglayer], setting.curimage)
}catch(e){
alert("Simple Controls Gallery: An error has occured somwhere in your code attached to the \"onslide\" event: "+e)
}
setting.currentstep+=1
if (setting.autoplay[0]){
if (setting.currentstep<=setting.totalsteps)
setting.playtimer=setTimeout(function(){slideshow.showslide('next')}, setting.autoplay[1])
else
slideshow.navigate("play/pause")
}
}) //end callback function
setting.gallerylayers[setting.fglayer].style.zIndex=999 //foreground layer becomes background
setting.fglayer=setting.bglayer
setting.bglayer=(setting.bglayer==0)? 1 : 0
setting.curimage=imgindex
setting.navbuttons[3].innerHTML=(setting.curimage+1) + '/' + setting.imagearray.length
if (setting.imagearray[imgindex][3]){ //if this slide contains a description
setting.$descpanel.css({visibility:'visible'})
setting.descdiv.innerHTML=setting.imagearray[imgindex][3]
}
else if (setting.longestdesc!=""){ //if at least one slide contains a description (feature is enabled)
setting.descdiv.innerHTML='';
setting.$descpanel.css({visibility:'hidden'})

}
},

clpix
01-20-2012, 12:57 PM
You're a one-man service industry! Thanks. Both worked, of course. Best, Christopher