HTMl源码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQ图片提示效果(可做改造)</title> <link href="css/imgAltShow.css" rel="stylesheet" type="text/css" /> <script src="JS/jquery.js" type="text/javascript"></script> <script src="JS/jquery.imgAltShow.js" type="text/javascript"></script> <script language="javascript" type="text/javascript"> window.onload = function() { imgAltShow(); } </script> </head> <body> <div> <img src="http://static12.photo.sina.com.cn/middle/4b5d9bc5g8817eedb5fdb&690" mce_src="http://static12.photo.sina.com.cn/middle/4b5d9bc5g8817eedb5fdb&690" width="150" alt="http://static12.photo.sina.com.cn/middle/4b5d9bc5g8817eedb5fdb&690" class="showimg" /> <img src="http://static11.photo.sina.com.cn/middle/4b5d9bc5g88180ae89a4a&690" mce_src="http://static11.photo.sina.com.cn/middle/4b5d9bc5g88180ae89a4a&690" width="150" alt="http://static11.photo.sina.com.cn/middle/4b5d9bc5g88180ae89a4a&690" class="showimg" /> <img src="http://static6.photo.sina.com.cn/middle/4b5d9bc5g881806faa4c5&690" mce_src="http://static6.photo.sina.com.cn/middle/4b5d9bc5g881806faa4c5&690" width="150" alt="http://static6.photo.sina.com.cn/middle/4b5d9bc5g881806faa4c5&690" class="showimg" /> </div> </body> </html> imgAltShow.css #tx { position: absolute; border: 1px solid #ccc; background: #333; padding: 2px; display: none; color: #fff; } jquery.imgAltShow.js function imgAltShow() { var x = 10; var y = 20; $("img.showimg").mouseover(function(event) { this.myTitle = this.alt; this.alt = ""; var topdiv = "<div id='tx'><img src="" + this.myTitle + "" mce_src="" + this.myTitle + "" alt='产品预览图'/></div>"; $("body").append(topdiv); $("#tx").css({ "top": (event.pageY + y) + "px", "left": (event.pageX + x) + "px" }).show('fast'); }).mouseout(function() { this.alt = this.myTitle; $("#tx").remove(); }).mousemove(function(event) { $("#tx").css({ "top": (event.pageY + y) + "px", "left": (event.pageX + x) + "px" }); }); } 效果图 源码下载:imgAltShow.rar