Jquery Cycle插件,动态ajax幻灯片加载问题
我已经在我的页面上设置了循环插件,并通过 ajax 将动态内容调用到页面中。然后我将此内容放入 div 中,然后运行插件。问题是,有时加载页面时它会完美地工作,然后当我刷新页面时它根本不会加载。
有什么建议吗?
$.ajax({
url: "http://www.site.co.uk/cgi-bin/latest-instructions-2.pl",
success: function(html){
$("#slider").html(html);
}
});
$('#slider').cycle({
fx: 'scrollLeft',
cleartype: true,
cleartypeNoBg: true,
pager: '#li-number2',
requeueOnImageNotLoaded: true
});
I have setup the cycle plugin on my page and im calling dynamic content into the page through ajax. I'm then putting this content into a div and then running the plugin. The problem is that it will work perfectly when loading the page sometimes and then when I refresh the page it will not load at all.
Any suggestions?
$.ajax({
url: "http://www.site.co.uk/cgi-bin/latest-instructions-2.pl",
success: function(html){
$("#slider").html(html);
}
});
$('#slider').cycle({
fx: 'scrollLeft',
cleartype: true,
cleartypeNoBg: true,
pager: '#li-number2',
requeueOnImageNotLoaded: true
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我设法找出我做错了什么,滑块在页面加载之前运行,我只是添加了一个窗口加载功能,所以......
I managed to figure out what I was doing wrong, the slider was running before the page had loaded I simply added a window onload function as so...