62,071
社区成员
发帖
与我相关
我的任务
分享
#imgshow
{
position:absolute;
border:1px solid #ccc;
background:#333;
padding:5px;
color:#fff;
display:none;
}
var ShowImage = function () {
xOffset = 10;
yOffset = 30;
jQuery(".img_head").hover(function (e) {
jQuery("<img id='imgshow' src='" + this.src + "' width='300px' />").appendTo("body");
jQuery("#imgshow")
.css("top", (e.pageY - xOffset) + "px")
.css("left", (e.pageX + yOffset) + "px")
.fadeIn("fast");
}, function () {
jQuery("#imgshow").remove();
});
jQuery(".img_head").mousemove(function (e) {
jQuery("#imgshow")
.css("top", (e.pageY - xOffset) + "px")
.css("left", (e.pageX + yOffset) + "px")
});
};