2014-06-23 26 views
1

我使用這個插件:Li-Scroller 這裏是代碼:Jquery Function Code如何停止液晶顯示器?

我有什麼辦法可以摧毀/停止/重新啓動時,它被應用到它(刪除所有div和標記,然後再次啓動它)一個通過函數的無序列表。

<ul id="ticker01"> 
    <li><span>10/10/2007</span><a href="#">The first thing ...</a></li> 
    <li><span>10/10/2007</span><a href="#">End up doing is ...</a></li> 
    <li><span>10/10/2007</span><a href="#">The code that you ...</a></li> 
    <!-- eccetera --> 
</ul> 
$("ul#ticker01").liScroll(); 

JSFiddle

+0

JS FIDDLE:http://jsfiddle.net/X5Ln7/ –

+0

您可以通過調用'$( 「#UL ticker01」)停止停止();',但它不具有任何功能。再次啓動它 - http://jsfiddle.net/X5Ln7/1/ – Pete

+0

謝謝。但是銷燬它並刪除所有標記標記呢?我將再次初始化該函數以重新啓動它。 –

回答

1

要停止並摧毀你只需要滾動條將停止動畫「撤消」一切儷滾動添加,所以你可以使用下面的jQuery:

$("ul#ticker01") 
    .clearQueue().stop()  //stops animation 
    .unwrap()     //removes mask div 
    .unwrap()     //removes tickercontainer div 
    .unbind()     //unbinds any events attached (like hover) 
    .removeClass('newsticker') //removes the extra class 
    .removeAttr('style');  //removes the height style 

Example

+1

它的工作原理,謝謝! –

0

,當你將鼠標懸停在文本

$("ul#ticker01").liScroll({travelocity: 0.15}); 
+0

是的,我知道。但我想摧毀滾輪。我的意思是刪除所有標記標記並刪除功能。 –