Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery $(document).ready broken in Iron/Chrome

I've written a little image slideshow using jQuery and jFancyTiles which can be seen here:

http://www.netzwerkag.at

It works as expected in firefox and IE, but not in iron/chrome.The problem seems to be in the timing of document.ready in chromium:

  • In line 76 the active class is set to the numbered circle-buttons in the lower right corner of the header image. This works!

  • In line 83 the image is changed by calling the fancy-tile-function, this doesn't work in chromium, at least not at this time.

When i open the iron_js_console via ctrl-shift-j and manually call the function everything works.

Additionally, if i wait 10 seconds it even progresses to the next image, in all browsers, no previous action needed.

The first call to fancytiles does not work in iron/chrome. This is called on jquery's document.ready event.

//What can I do?

like image 774
santa Avatar asked Apr 08 '11 14:04

santa


1 Answers

I ran into a similar issue with both FF4 and Chrome. jQuery(document).ready wasn't working. I was able to get it working with jQuery(window).load. I'm not sure what changed in FF4, but they seemed to have made it more similar to how Chrome does things. When I changed it to use jQuery(window).load, it also cleared up issues I was having in Chrome.

like image 185
Vivin Paliath Avatar answered Nov 07 '22 20:11

Vivin Paliath