I'm suing the jQuery cycle plug-in and it's awesome. However, there's one issue that I can't seem to get around.
My pages are loading via Ajax, but if I refresh a page directly through the browser, it's as if the timeout is still based on the previous pageview.
The slides themselves work properly, but the active slide on the pager is highlighting the wrong piece. Any idea how to reset the timeout or how to reset cycle on a fresh load - $('#divid').cycle('pause开发者_运维知识库')
and $('#divid').cycle('stop')
don't seem to to the trick.
Thanks for any insight.
Would that happen to be primarily in Firefox? I've noticed this behavior with FF in particular, it seems to hold the javascript state on page refresh. If not the whole state, then part of it. Here's something you can try:
Instead of clicking the refresh button or hitting F5, put your cursor in the address bar and hit enter. From my observation, this seems to fetch the page again, and re-render it, clearing any previous javascript state that it may be holding.
If your problem still happens after doing the enter-on-address bar trick, then you know it's the code that's causing it, not the browser.
精彩评论