jQuery提示效果代码分享

前端之家收集整理的这篇文章主要介绍了jQuery提示效果代码分享前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

代码一:

代码如下:@H_403_4@

@H_403_4@

代码如下:@H_403_4@
403_4@" $("body").append(a); $("div").css({ "top": (e.pageY + y) + "px", "left": (e.pageX + x) + "px" }).show("fast") }).mouSEOut(function(){ this.title= this.mytitle; $("div").remove(); }); }) @H_403_4@

学习心得:

不要在p标签下追加div元素,会出现一个大的偏差值!

原来!this和$("this")是有所不同,如果上文
this.title改写成$("this").attr("title")会导致下面的mouSEOut事件无法访问保存下来的title

代码二:

引用css:jqueryui/css/ui-lightness/jquery-ui-1.8.18.custom.css 引用js:jqueryui/js/jquery-ui-1.8.18.custom.min.js

代码如下:@H_403_4@
$( "#dialog:ui-dialog" ).dialog( "destroy" );

$( "#dialog-message" ).dialog({

height: 120,
width: 220,
modal: true,
buttons: {
"否": function() {
//dosomething
$( this ).dialog( "close" );
},
"是": function() {
//dosomething
$( this ).dialog( "close" );
}
}
});