我面臨同樣的問題顯示相鄰元素的另一個彈出。以下是我自己管理鼠標事件的代碼。我希望這個腳本能幫助你。
<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請求。
你能搗鼓嗎? – Andre 2011-04-19 13:10:52
在此發佈您的代碼以幫助我們爲您提供幫助。 – tenshimsm 2011-04-20 12:31:41