首先需要
<script src="scripts/jquery.js"></script>
<script src="scripts/jquery.dimensions.js"></script>
<script src="scripts/jquery.tooltip.js"></script>
<script type="text/javascript">
$(function() {
$(′[title]′).tooltip({showURL:false});
$(′img.preview′).tooltip({showURL:false,fade:true,delay:250,left:5,top:5,
bodyHandler: function() {
str = "<img width=′400′ src=′" + this.src + "′ />";
if( this.tooltipText )
str += "<span>" + this.tooltipText + "</span>";
return $(str);
}
});
});
</script>
定义了两个工具提示,设置了title 属性的,会显示文字工具提示,所有class="preview"的图片鼠标经过会显示宽度400的放大图片提示。演示参看 http://www.fish-soso.com
相关脚本文件,本站提供 打包下载
