2011-01-23 17 views

回答

0

我這樣做的方式是:我將標記存儲在數組上,並且在創建標記時檢查位置上的標記是否已嘗試添加新標記已存在。如果爲true,則使用this idea將標記在近point.Hope它有助於

0

OMG ......我記得那是不好玩......但解決的辦法是這樣的:

你有陣列中所有的職位和頭銜/內容。在遍歷該數組時,您將位置添加到其他數組。如果當前位置在該數組中,則不添加該標記,而是添加該標記以冒泡當前標記的內容。

在泡泡我有兩個按鈕來切換內容項目。

開關是不容易實現儘可能通用(對我來說),但在這裏你有代碼:

wrapper.find('.bubble_next').bind('click', function(event){ 
       var active = $(this).parent().find('.active'); 
       var next = active.next('.list_item'); 
       if(next.length == 0) { 
        var all = $(this).parent().find('.list_item'); 
        next = $(all[0]); 
       } 

       active.hide(); 
       next.fadeIn(200); 
       next.addClass('active'); 
       active.removeClass('active'); 

       var items = $(this).parent().find('.list_item'); 
       for(var i=0; i<items.length; i++) if($(items[i]).hasClass('active')) $(this).parent().find('.bubble_index').text((i+1)); 

      }); 

其中泡沫指數爲標誌的一些指標,並在泡沫包裝器層其中包含內容項目層。我認爲其餘的CSS類正在爲自己說話。