Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery cycle plugin (often) doesn't work in Google Chrome

For some reason, when I first go to a recent page I built, the jQuery Cycle plugin does not work. The site is located here (site is in a different language [Hebrew]).

Regardless of the language it's in, the Cycle plugin works fine in Firefox and IE. I'm wondering if this is a bug on my end or a bug on the plugin's end.

If it's a bug on my end, how can I fix it?

like image 477
Amit Avatar asked Oct 16 '11 21:10

Amit


2 Answers

The solution to this problem, based on the fact that Google Chrome fails to properly render the height of the dynamically generated div's (as @ulima69 observed), is to give the wrapping div (.slideshow) a designated width & height that is congruent with the images' width/height.

This fixes the bug for now. If the images were all different dimensions, a more complicated solution should be sought. @ulima69 provided two links to alternative cycle plugins that should work with Chrome. Do what works for you.

Amit

like image 89
Amit Avatar answered Oct 24 '22 17:10

Amit


You have to use .load instead of .ready to allow the images to load on the page

$(window).load(function() {
    $('.element').cycle();
});
like image 32
Mike Sawicki Avatar answered Oct 24 '22 16:10

Mike Sawicki