【发布时间】:2015-02-27 14:14:41
【问题描述】:
我有这个代码
function DrawTipsProgress(postid, ajaxurl) {
var data = {
action: 'ajax_action',
post_id: postid
}
jQuery('#dashicon-' + postid).on("click", function () {
jQuery.post(ajaxurl, data, function(response) {
jQuery('#dashicon-' + postid).tooltip({
position: { my: 'center bottom' , at: 'center top-10' },
tooltipClass: "myclass",
content: response
});
jQuery('#dashicon-' + postid).tooltip('open');
});
});
}
第一次点击时,它按方面工作。 如果稍后我尝试再次悬停按钮而不单击它,则再次弹出工具提示,单击只是执行 ajax 调用,但不会打开工具提示。
【问题讨论】:
标签: javascript jquery ajax jquery-ui jquery-ui-tooltip