2011-12-30 152 views
0

我的網站上有一個jCarouselLite插件。我從jquery.load函數加載li的。我垂直旋轉轉盤,並有一個功能,一旦第一個項目回到頂端就會觸發。jCarouselLite重新綁定數據

此時,我想用另一個ajax.load刷新數據。這是我遇到問題的地方。一旦數據重新加載,傳送帶停止旋轉(或者說,在後臺運行)。

一個解決方案我想是嘗試重新instating傳送帶與另一:

$("#tableapp").jCarouselLite({}) 

線。這似乎導致兩個輪播在同一時間運行。然後是第三,第四,依此類推。

所以基本上我正在尋找一些方法來清除傳送帶,重新加載更新的數據,然後再次運行它。有任何想法嗎?

$(document).ready(function() { 
      updateConsole() //Gets new data 
      scrollWindow()  //Starts carousell 
    }); 

    function updateConsole() { 
     $('#tableapp').load('AjaxPages/ApplicationMonitor.aspx #application'); 
    } 

    function scrollwindow() { 
     $("#tableapp").jCarouselLite({ 
      vertical: true, 
      hoverPause: true, 
      visible: 4, 
      auto: 6000, 
      speed: 500, 
      scroll: 4, 
      circular: true, 
      afterEnd: function (a) { ScrollEnd(a); } 
     }); 
    }; 

    function ScrollEnd(a) { 
     $('#tbDebug').val($('#tbDebug').val() + '\nScroll Ends'); 

     if (**code that determines slide 1 is back on top**) { 
      updateConsoles(); 
      scrollWindow(); //If this code is commented, the carousel stops cycling. 
          //If it isn't commented, two carousels start and things 
          //get buggy and eventually freezes. 
     } 
    } 

我非常新的JavaScript,jQuery的,等等。我也試過這個對的jCarousel(未精簡版),但我無法得到它與垂直滾動工作。它似乎是越野車。

+0

爲了解決這個問題,我最終開始使用jCarousel而不是jCarouseLite。 – lorengphd 2012-01-09 18:35:02

回答