Code:
<script type="text/javascript">
var mygallery=new fadeSlideShow({
wrapperid: "banner", //ID of blank DIV on page to house Slideshow
dimensions: ['100%', 350], //width, height of gallery in jQuery css dimensional values
imagearray: [
["banner_A.jpg", "", "", "Information about banner image A goes here"],
["banner_B.jpg", "", "", "Information about banner image B goes here"],
["banner_C.jpg", "", "", "Information about banner image C goes here"],
["banner_D.jpg", "", "", "Information about banner image D goes here"]//<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
//this code resizes the show based upon width of the parent div
oninit: function(){
var g = this, s = g.setting, $wrap = s.$wrapperdiv, $desc = s.$descpanel, h, $dbg = $desc.find('div.descpanelbg'), $dfg = s.$descinner;
$wrap.css({height: (h = $wrap.width() * 350 / 960)}); //ratio for images (native dimensions height / width)
if(!$wrap.data('descwidthsetup')){
jQuery(window).resize(function(){s.oninit.apply(g);});
function stripwidth($el){
var extras = ['borderRightWidth', 'borderLeftWidth', 'marginRight', 'marginLeft', 'paddingRight', 'paddingLeft'],
el = extras.length, extra = 0, v;
while(--el > -1){v = parseFloat($el.css(extras[el])); extra += isNaN(v)? 0 : v;}
return extra;
}
s.descwidthminus = [stripwidth($dbg.height('200%')), stripwidth($dfg)];
}
$wrap.data({descwidthsetup: 'setup'});
$wrap.trigger('mouseleave');
this.showhidedescpanel('hide', 0);
$dbg.width($desc.width() - s.descwidthminus[0]);
$dfg.add(s.$measure).width($desc.width() - s.descwidthminus[1]).css('marginLeft', $dfg.css('marginLeft'));
},
togglerid: ""
})
</script>
Notice the two highlighted lines. For the first, set the red part width to '100%' and the height to the native height of the images (all images must be the same dimensions for this to work well). For the second, set the red part to the image's native height / the images native width. This will be used to adjust the height of the slideshow and the images for different widths. So the first is 'width%', height and the second height / width.
Bookmarks