Slideshow with responsive Themes and/or different picture heights
Permalink 5 users found helpfulproblem:
using a responsive layout with a slideshow creates bad effects, as the wrapper size is set to the true height of the picture, and not to the displayed size. Also the slideshow creates a background-image, which doesn't resize at all to fit into the page.
Example: using img {max-width: 100%) with an image sized 800x600 looks nice in the fullsized website, but on a mobile device the wrapper is still set to 600px height, but the displayed height is around 400px. so 200px of space are wasted.
solution:
modify the blocks/slideshow/view.php like this:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <script type="text/javascript"> //<![CDATA[ var ccmSlideShowHelper<?php echo intval($bID)?> = { bID:<?php echo intval($bID)?>, imgNum:0, init:function(){ this.displayWrap=$('#ccm-SlideshowBlock-display'+this.bID); if(this.imgInfos.length==0){ return false; } var maxHeight=0; for(var i=0;i<this.imgInfos.length;i++){ this.addImg(i); if(maxHeight==0 || this.imgInfos[i].imgHeight > maxHeight)
change the "500" to a lower value to speed up the animation:
$('#slideImgWrap0').parent().animate({height:imageHeight, queue: false},500);
or use another jQuery option to change it.
But I can´t turn it of because I don´t know how. I just want it without the animation. Like it´s just loading like the normal slideshow. Is that difficult to change?
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <script type="text/javascript"> //<![CDATA[ var ccmSlideShowHelper<?php echo intval($bID)?> = { bID:<?php echo intval($bID)?>, imgNum:0, init:function(){ this.displayWrap=$('#ccm-SlideshowBlock-display'+this.bID); $('#ccm-SlideshowBlock-display'+this.bID).css('overflow','hidden'); if(this.imgInfos.length==0){ return false; } var maxHeight=0; for(var i=0;i<this.imgInfos.length;i++){ this.addImg(i);
I have been looking at a solution for this, and this works!
However, it feels almost animated when the image renders. Do you know why that is?