1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <spandata-helperinfo= "PortfolioTeam" class= "icon help" ></span>
$(document).on({
mouseenter: function () {
var HelpMsgCode = $( this ).attr( "data-helperinfo" );
$.ajax({
type: "GET" ,
url: "/Portfolio/GetHelpMessageByCode" ,
data: { Code: HelpMsgCode },
dataType: "json" ,
success: function (item) {
var varJson = $.parseJSON(item.data);
var varContent = varJson.Root.HelpMessage.Content;
var varMsgHtml = "<span class='bubble'>" + varContent + "</span>" ;
$( ".icon.help" ).append(varMsgHtml);
}
});
},
mouseleave: function () {
$( ".icon.help" ).html( "" );
}
}, ".icon.help" );
|
登录后复制
以上是jquery使用on绑定mouseleave事件与mouseenter事件实现鼠标hover事件的实例分析的详细内容。更多信息请关注PHP中文网其他相关文章!