PDA

View Full Version : Hacked Slide Show Hack to show only horizontal photos


Desert-Rat
Sep-11-2007, 11:52 PM
The hack applies to BigWebGuy's slideshow version 0.58. When drawing from a gallery containing both vertical and horizontal photographs, I wanted only horizontal photographs showing in the slideshow. In the javascript function slideshowHandler, add these two lines:



if (oSlide.Width > oSlide.Height) { <--ADD

if ((oSlide.Width > photoWidth) || (oSlide.Height > photoHeight)) {
if (oSlide.Width >= oSlide.Height) {
oSlide.Height = Math.round((oSlide.Height / oSlide.Width) * photoWidth);
oSlide.Width = photoWidth;
} else {
oSlide.Width = Math.round((oSlide.Width / oSlide.Height) * photoHeight);
oSlide.Height = photoHeight;
}
}

ssSlideTotal = ssSlides.push(oSlide);
} <--ADD


Seems to work. Hopefully it doesn't stomp on any of his other code.
Has anyone setup BigWebGuy's slideshow where multiple galleries are feeding one slideshow?