OK, well let's see .scalable is:
Code:
/*Utility Rules for images. Scalable class makes images scale with window size.*/
img.scalable {
height: auto !important;
width: auto !important;
max-width: 100%;
vertical-align: bottom;
}
That means that the images will never be any wider than they actually are, but that if where they are is narrower than they are, they will scale down to fit the width. And playing with the demo page you linked to, it appears that width is the primary concern.
First backup what you have, just in case. Then where you have (which only does the gallerylayer divs, there is no id="fadeSlideShow" element):
Code:
<!--This code changes the background color from black to white-->
<style type="text/css">
#fadeSlideShow, #fadeSlideShow, .gallerylayer {
background-color: white !important;
}
</style>
<!--End background color code change-->
Make that (the margin-left for the .descpanelfg selector eliminates the need for all those characters in the imagearray, and will allow for proper formatting of multi-line descriptions):
Code:
<!-- This code changes the background color to white, makes the slide images scalable and moves descriptions to the left -->
<style type="text/css">
#banner, .gallerylayer {
background-color: white !important;
}
.gallerylayer img {
height: auto !important;
width: auto !important;
max-width: 100%;
vertical-align: bottom;
}
.descpanelfg {
margin-left: 28px;
}
</style>
<!-- End image scalability, background color change, format descriptions code -->
And for what follows, update jQuery. Change:
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.8/jquery.min.js"></script>
Now what about the slideshow itself? It has:
Code:
var mygallery=new fadeSlideShow({
wrapperid: "banner", //ID of blank DIV on page to house Slideshow
dimensions: [960, 350], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["image . . .
Here's a rewrite of the script, where you can specify the dimensions as percents or any other valid css dimensional value (right click and 'Save As'):
fadeslideshowresp.js
Oh, and you need the loading image, put it in the same folder as your page (also right click and save as):

And replace the whole var mygallery=new fadeSlideShow({ section with (Notice that since the percent is not a raw number it has to be quoted):
Code:
var mygallery=new fadeSlideShow({
wrapperid: "banner", //ID of blank DIV on page to house Slideshow
dimensions: ['100%', 350], //width/height of gallery in css dimensional values.
imagearray: [
["images/banner_A.jpg", "", "", "Information about banner image A goes here"],
["images/banner_B.jpg", "", "", "Information about banner image B goes here"],
["images/banner_C.jpg", "", "", "Information about banner image C goes here"],
["images/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 targets a hotspot on mouseover for pop-up descriptions and resizes the show based upon width of the parent div
oninit: function(){
var descvis, g = this, s = g.setting, $wrap = s.$wrapperdiv, $desc = s.$descpanel, h, mm;
$wrap.css({height: (h = $wrap.width() * 350 / 960)});
if((mm = $wrap.data('mm'))){$wrap.unbind('mousemove', mm).unbind('mouseleave', $wrap.data('ml'));}
else{jQuery(window).resize(function(){s.oninit.apply(g);});}
$wrap.data({mm: function(e){
var o = $wrap.offset(), x = e.pageX, y = e.pageY, top = o.top + h - 25, left = o.left + 25,
evt = x < left && y > top? 'mouseenter' : y <= top && descvis || !descvis? 'mouseleave' : null;
evt && $wrap.trigger(evt);
descvis = evt !== 'mouseleave';
s.ismouseover = true;
}, ml: function(){descvis = false;}});
$wrap.trigger('mouseleave').mousemove($wrap.data('mm')).mouseleave($wrap.data('ml'));
this.showhidedescpanel('hide', 0);
$desc.find('div').css({width: $desc.width() - 8});
},
togglerid: ""
})
Notice also the highlighted line with the red 350 / 960, that's the ratio we want to maintain. It's the actual height over the actual width. If those change then they need to be updated there as well. And see that the characters are no longer needed in the imagearray
The browser cache may need to be cleared and/or the page refreshed to see changes.
Bookmarks