从 AnythingSlider 中删除所有面板并重新启动插件
我使用 AnythingSlider 来显示推文、博客文章、flickr 照片和 YouTube 视频的混搭,最初效果很好。我正在尝试添加排序功能,但为此我需要删除按钮单击 -> 上的所有幻灯片添加新幻灯片 ->并重新初始化插件。
AnythingSlider 文档(以及代码)暗示了删除幻灯片的能力,并且插件应该轻松处理它。我在任何地方都找不到任何类型的删除代码,所以我想这样的东西会起作用:
$("#slider li:not(.cloned)").remove();
但到目前为止我还没有运气。有人有这样的经历吗?非常感谢。
I'm using the AnythingSlider to display a mashup of tweets, blog posts, flickr photos, and youtube videos, and initially it works great. I'm trying to add sort functionality, but to do so I need to remove all slides on a button click -> add the new slides -> and re-initialize the plugin.
The AnythingSlider documentation (as well as the code) hints at the ability to remove slides and the plugin should just take it in stride. I haven't been able to find any kind of remove code anywhere, so I fiugured something like this would work:
$("#slider li:not(.cloned)").remove();
but so far i've had no luck. Anyone have any experience with something like this? Many Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有任何内置代码可以删除幻灯片,因此您可以使用上面的代码,或者如果您确实只想删除所有幻灯片,请执行以下操作(无需避免删除克隆的幻灯片):
然后添加任何新内容您想要的幻灯片(排序或其他)
然后更新滑块
上面的代码本质上与 AnythingSlider 演示中看到的代码相同页面(主题选择器旁边的按钮)。我已将其包含在下面并附有更多评论:)
There isn't any built in code to remove slides, so you could use the code above, or if you really want to just remove all the slides, do this (no need to avoid removing the cloned slides):
Then add in whatever new slides you want (sorted or whatever)
Then update the slider
The above code is essentially the same code as see on the AnythingSlider demo page (the buttons next to the theme selector). I've included it below with more comments :)