On a virgin Bluemasters template install on a virgin D7.30, the images in the front page gallery do not repeat/loop when playing. Also, clicking the dots doesn't work, allowing you to switch images. Tested on Firefox 31.0 and Chrome 38.0.2107.2 dev (64-bit).
http://bluemasters.melodytanishorner.com/drupal/
The functions are in bluemasters.js . This is how they were provided. Help appreciated. Thanks!
jQuery(document).ready(function($) {
//Set Default State of each portfolio piece
$(".paging").show();
$(".paging a:first").addClass("active");
//Get size of images, how many there are, then determin the size of the image reel.
var imageWidth = $(".window").width();
var imageSum = $(".image_reel img").size();
var imageReelWidth = imageWidth * imageSum;
//Adjust the image reel to its new size
$(".image_reel").css({'width' : imageReelWidth});
//Paging + Slider Function
rotate = function(){
var triggerID = $active.attr("rel") - 1; //Get number of times to slide
var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
$(".paging a").removeClass('active'); //Remove all active class
$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
$(".desc").stop(true,true).slideUp('slow');
$(".desc").eq( $('.paging a.active').attr("rel") - 1 ).slideDown("slow");
//Slider Animation
$(".image_reel").animate({
left: -image_reelPosition
}, 500 );
};
//Rotation + Timing Event
rotateSwitch = function(){
$(".desc").eq( $('.paging a.active').attr("rel") - 1 ).slideDown("slow");
play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
$active = $('.paging a.active').next();
if ( $active.length === 0) { //If paging reaches the end...
$active = $('.paging a:first'); //go back to first
}
rotate(); //Trigger the paging and slider function
}, 10000); //Timer speed in milliseconds (3 seconds)
};
rotateSwitch(); //Run function on launch
//On Click
$(".paging a").click(function() {
$active = $(this); //Activate the clicked paging
//Reset Timer
clearInterval(play); //Stop the rotation
rotate(); //Trigger rotation immediately
rotateSwitch(); // Resume rotation
return false; //Prevent browser jump to link anchor
});
});
Comments
Comment #1
mfuller526 commentedComment #2
mfuller526 commentedComment #3
realskorpion commentedSame issue here.
Thanks
Comment #4
realskorpion commentedHi,
I found the "problem" and a solution.
Solution:
1. Open this file: sites/all/themes/bluemasters/template.php
2. Find this line:
$animation_time= (int) theme_get_setting('slideshow_animation_time','bluemasters')*1000;
3. Change that line for this one:
$animation_time= (double) theme_get_setting('slideshow_animation_time','bluemasters')*1000;
4. Clear your site's caches and reload
The problem is that the animation duration for this theme is 0.5 by default and the (int) casting was truncating the calculation
and making the slideshow to fail.
I don't know if this is a nice/correct fix but it works for me.
Thanks
Comment #5
mfuller526 commentedBingo! It works. Problem solved. Thank you! And thank you for a clear step by step explanation.
Comment #6
mfuller526 commentedComment #7
realskorpion commentedComment #8
schifazl commentedWell done, works for me :)
Comment #9
bingo76 commentedMany thanks - really appreciated you posting this.
Comment #10
adezafra commentedThank you so much for posting this! Works great. Tested in Safari, Chrome, and IE. Also tested on mobile device. Great fix.
Comment #11
djsagar commentedThis patch fixed loop problem in Slideshow
Comment #12
ravi.shankar commentedPatch #11 looks good to me and applied cleanly so moving it to RTBC.
Comment #14
gaurav.kapoor commentedComment #15
gaurav.kapoor commented