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

烈酒焚心 提交于 2019-12-09 17:56:33

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/5596904/jquery-document-ready-broken-in-iron-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!