简体   繁体   English

如何销毁jquery幻灯片并使用默认样式加载元素?

[英]How Can I destroy a jquery slideshow and load elements with default style?

I am using a jquery slideshow plugin called superslides . 我正在使用一个名为superslides的jquery幻灯片插件。 I wanted to implement a multi styled page for my quote site . 我想为我的报价站点实现一个多样式的页面。 By default the slideshow plugin is initiated. 默认情况下,幻灯片插件已启动。 I need to destroy the slide effect on button click and load grid view for my elements. 我需要破坏按钮单击时的滑动效果,并为我的元素加载网格视图。 I have tried removing the id for the slideshow markup and then do an ajax load,but it doesn't work! 我曾尝试删除幻灯片标记的ID,然后进行Ajax加载,但这不起作用! This jquery plugin has a destroy api $('#slides').superslides('destroy') . 这个jQuery插件有一个destroy api $('#slides').superslides('destroy')

<div id="slides">
  <div class="slides-container">
    <h2>This is a quote</h2>
    <h2>This is another</h2>
  </div>
</div>

If the destroy option isn't working for you, the next best thing might be to clone the container element in a global variable before you convert it to a slideshow: 如果destroy选项不适合您,那么下一件最好的事情可能是在将容器元素转换为幻灯片之前,将其复制到全局变量中:

$pre_slideshow = $('#slides').clone();
$('#slides').superslides();
// later, when you want to restore it....
$('#slides').replaceWith($pre_slideshow);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM