2011-04-19 30 views
0

我使用jQuery氣泡彈出v 2.3.1 http://www.vegabit.com/jquery_bubble_popup_v2/問題與jQuery氣泡彈出v 2.3.1

我同時使用這與真正的選擇兩個相鄰的元素越來越問題。 當我將鼠標放在一個上面並將鼠標移動到氣泡上方時;如果鼠標到達泡泡背面的另一個元素,則第二個泡泡會出現在第一個泡泡的上方。意味着一次顯示兩個氣泡。

我希望只有當氣泡可見時才顯示氣泡(不在顯示的氣泡後面),並且我一次只能將氣泡放在其上一個氣泡上。 請幫忙!

+0

你能搗鼓嗎? – Andre 2011-04-19 13:10:52

+0

在此發佈您的代碼以幫助我們爲您提供幫助。 – tenshimsm 2011-04-20 12:31:41

回答

0

我面臨同樣的問題顯示相鄰元素的另一個彈出。以下是我自己管理鼠標事件的代碼。我希望這個腳本能幫助你。

<script type="text/javascript"> 
    jQuery(document).ready(function() { 
      var MouseOverOnBubble = false;   
      jQuery('.ClassName').CreateBubblePopup({         
       themeName: 'all-azure', 
       themePath: 'jquerybubblepopup-theme', 
       manageMouseEvents: false 
       });   
       jQuery('.ClassName').mouseover(function(){       
         var button = jQuery(this); 
         var info = "something"; 
         var generatedId = button.GetBubblePopupID(); 
         if(!button.IsBubblePopupOpen()) 
         {    
          jQuery.get('getData.php?data='+info, function(data) { 
           var seconds_to_wait = 1; 
           function pause(){ 
            var timer = setTimeout(function(){ 
             seconds_to_wait--; 
             if(seconds_to_wait > 0){ 
              pause(); 
             }else{ 
              button.SetBubblePopupInnerHtml(data, true); //false -> it shows new innerHtml but doesn't save it, then the script is forced to load everytime the innerHtml...            
              button.ShowBubblePopup();//Its freezes bubble until .UnfreezeBubblePopup(),.ShowBubblePopup() or .HideBubblePopup() are called.        
              jQuery('#'+generatedId).mouseover(function(){MouseOverOnBubble = true;jQuery('#'+generatedId).css('display','block');});  
              jQuery('#'+generatedId).mouseout(function(){MouseOverOnBubble = false;jQuery('#'+generatedId).css('display','none');}); 
             }; 
            },1000); 
           };pause();       
          }); 
         } 
         else 
         { 
          jQuery('#'+generatedId).css('display','block'); 
         } 

       }); //end mouseover event 
      jQuery('.ClassName').mouseout(function(){ 
       var button = jQuery(this);        
       var seconds_to_wait = 1; 
       function pause(){ 
        var timer = setTimeout(function(){ 
         seconds_to_wait--;     
         if(seconds_to_wait > 0){ 
          pause(); 
         }else{ 
          if(!MouseOverOnBubble){button.HideBubblePopup();} 
         }; 
        },1000); 
       };pause();    
      }); 
    }); 
</script> 

您也可以用$就嘗試用來從這裏你可以設置beforeSend爲泡沫彈出設置預載圖片Ajax請求。