I'm not sure I understand all of what you're asking for. And there are at least two ways to do one of the parts I do understand.
First what I don't get:
"I would like to left justify the caption text so that it aligns with the left edge of the slide."
It sort of does this already, just a matter of a few pixels, right?
If so, and I see you've given the captions spans with a class, then you could use a style like so to pull them the rest of the way:
Code:
.caption-text {
position: relative;
display: block;
left: -10px;
}
Or:
Code:
.caption-text {
display: block;
margin-left: -10px;
}
OK, on to the restore or info button as it now is. Try this out -
Update to jQuery 1.6.4 (this isn't required for this, it fixes a bug with the existing page and IE 8, and is simply a more stable version), change this:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
to:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
Grab my extrabuttons.js file (right click and save as). And put it in the same folder as the page. Add its tag after the fadeslideshow.js tag, so that whole section will now look like so:
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="fadeslideshow.js">
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript" src="js/extrabuttons.js">
// Extra Buttons Script (c)2011 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// add on for Ultimate Fade In Slideshow
// username: jscheuer1 - This Notice Must Remain for Legal Use
</script>
<script type="text/javascript">
var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank D . . .
The extrabuttons.js adds an onbeforeslide event to the slideshow, which we will need in the next part - In the on page call add the highlighted:
Code:
var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [700, 467], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/project-large/berkeley-hills2010/bh1.jpg", "", "", "<span class='caption-text'>Lorem ipsum dolor sit amet, vim quando soluta ut, vis te vivendo ponderum splendide. Mel no augue facilisis vituperatoribus. Sale eirmod insolens mel an, vis te adhuc simul instructior. Nec iudico accusam et, esse democritum mei et. Ei sed phaedrum evertitur. Meliore conceptam has id. Ad his viderer detracto, te eam brute liberavisse. Ea unum tation mel, nec natum movet dicant ei. At ius case magna fugit. Illud assueverit efficiantur pro ei, enim ignota incorrupte no sea. No sit veritus reformidans, ne est oblique eleifend conceptam. Mazim virtute cu has. Et eos odio fastidii convenire, has cetero vulputate vituperata eu. Ne vel bonorum dolorem, ad erat minim voluptua per. Sed no quod graeci gubergren.</span>"],
["images/project-large/berkeley-hills2010/bh2.jpg"],
["images/project-large/berkeley-hills2010/bh3.jpg"],
["images/project-large/berkeley-hills2010/bh4.jpg", "", "", "<span class='caption-text'>caption here</span>"],
["images/project-large/berkeley-hills2010/bhtanks.jpg", "", "", "<span class='caption-text'>Construction photo of tanks installation for rainwater catchment system</span>"],
["images/project-large/berkeley-hills2010/bh6.jpg"]
],
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler",
oninit: function(){this.showhidedescpanel('hide', 0);}, //start out with captions hidden
onbeforeslide: function(idx){
var set = this.setting;
if(set.$restorebutton.css('visibility') === 'visible' && !set.imagearray[idx][3]){
set.$restorebutton.hide();
} else {
set.$restorebutton.show().animate({
right: set.dimensions[0] - set.$gallerylayers.find('img').eq(idx).width()
});
}
}
})
Don't miss the added comma (red) after the togglerid value.
That's it for starting out with the descriptions hidden and for not showing the info button when there is no caption, and for aligning the info button to the right edge of the image. Those last two bits are where I'm a little unclear as to what to do. In the above I have it:
Code:
} else {
set.$restorebutton.show().animate({
right: set.dimensions[0] - set.$gallerylayers.find('img').eq(idx).width()
});
}
What this does is if there was no caption for the previous image, makes the info button appear and then slide into position if it's different than where it would have been had the previous image had a caption. This is how I did it at first. But we could instead do it like so:
Code:
} else {
set.$restorebutton.animate({
right: set.dimensions[0] - set.$gallerylayers.find('img').eq(idx).width()
}, function(){set.$restorebutton.show();});
}
What this does is if there was no caption on the previous image, the info button pops into view after positioning itself.
After seeing it the first way, I though this would be better, but after seeing it both ways, I like the first one now. You can try them both out and decide for yourself.
Added Later:
I was playing around with this a bit more and it looked funny that the info button aligned with the image but that the close button didn't. It was trickier than with the info button, but I worked it out:
Code:
var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [700, 467], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["images/project-large/berkeley-hills2010/bh1.jpg", "", "", "<span class='caption-text'>Lorem ipsum dolor sit amet, vim quando soluta ut, vis te vivendo ponderum splendide. Mel no augue facilisis vituperatoribus. Sale eirmod insolens mel an, vis te adhuc simul instructior. Nec iudico accusam et, esse democritum mei et. Ei sed phaedrum evertitur. Meliore conceptam has id. Ad his viderer detracto, te eam brute liberavisse. Ea unum tation mel, nec natum movet dicant ei. At ius case magna fugit. Illud assueverit efficiantur pro ei, enim ignota incorrupte no sea. No sit veritus reformidans, ne est oblique eleifend conceptam. Mazim virtute cu has. Et eos odio fastidii convenire, has cetero vulputate vituperata eu. Ne vel bonorum dolorem, ad erat minim voluptua per. Sed no quod graeci gubergren.</span>"],
["images/project-large/berkeley-hills2010/bh2.jpg"],
["images/project-large/berkeley-hills2010/bh3.jpg"],
["images/project-large/berkeley-hills2010/bh4.jpg", "", "", "<span class='caption-text'>Their disturbing unicorns acutely step to their exigent turtles. Your abiding chocolates abominably accept your admiring parrots. Their admonishing penguins ab</span>"],
["images/project-large/berkeley-hills2010/bhtanks.jpg", "", "", "<span class='caption-text'>Construction photo of tanks installation for rainwater catchment system</span>"],
["images/project-large/berkeley-hills2010/bh6.jpg"]
],
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "always",
togglerid: "fadeshow2toggler",
oninit: function(){this.showhidedescpanel('hide', 0);},
onbeforeslide: function(idx){
var set = this.setting, w = set.$gallerylayers.find('img').eq(idx).width() - 8;
if(set.$hs){set.$hs.remove();}
set.$hs = jQuery('<style type="text/css">.caption-text{width:' + (w - 8) + 'px;}<\/style>').appendTo('head');
set.$measure.css({width: w});
if(set.$descpanel.css('visibility') === 'hidden'){
set.$descinner.css({width: set.dimensions[0] - 8});
}
set.$descinner.animate({width: w});
if(set.$restorebutton.css('visibility') === 'visible' && !set.imagearray[idx][3]){
set.$restorebutton.hide();
} else {
set.$restorebutton.show().animate({
right: set.dimensions[0] - set.$gallerylayers.find('img').eq(idx).width()
});
}
}
})
Bookmarks