I m trying to trigger something with jquery when the user clicks the "x" to close the qtip2 modal.
这里,我为我的Modal提出共同意见:
<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>
如果你注意到“hide:功能(event,api){”线,那么当用户在路面点外点击关闭时,该工作就会被罚款,但当用户点击“x”关闭该模式时,它就关闭了该模式。 当用户点击“x”时,我怎么能“做什么”?
感谢。