當用戶單擊「x」關閉qtip2模式時,我試圖用jquery觸發某些內容。Qtip2 Modal,關閉模式時觸發事件
這裏是我JS爲我的模態:
<script language="javascript" type="text/javascript">
$('.show_likes_modal').live('mouseover', function(event) {//SHOW LIKES MODAL
clearInterval(auto_refresh); auto_refresh = 0;
var itemid = $(this).attr("itemid");
var itemtype = $(this).attr("itemtype");
$(this).qtip({
id: 'likesmodal',
content: {
text: '<img src="images/loading.gif" alt="Loading..." />',
ajax: {url: 'modals/show_likes.php',type: 'GET',data: { itemid: itemid,itemtype:itemtype}},
title: { text: 'People who like this:',button: true}
},
position: {my: 'centered',at: 'centered',target: $(window)},
show: {event: 'click',solo: true,modal: true},
hide: false,
style: 'ui-tooltip-light ui-tooltip-rounded',
events: {
hide: function(event, api){
auto_refresh = setInterval(function(){$('#bottom_middle').load(thisurl + '&timer=' + new Date().getTime() + ' #bottom_middle');}, 5000);
$(this).qtip("destroy");
}
}
});
return false;
});
</script>
如果您發現「隱藏:函數(事件,API){」行,這項工作很好,當模式之外,用戶點擊將其關閉,但是當用戶點擊「x」關閉模式時,它只會關閉模態。如何在用戶點擊「x」時「做些什麼」?
謝謝。