0
<script type=text/javascript src=http://code.jquery.com/jquery-1.8.2.js></script>
<script type=text/javascript>
$(document).ready(function(){
$("#image").mousemove(function(e) {
$("#pop-up").fadeIn(0);
$("#pop-up").offset({
top: e.pageY - $("#pop-up").outerHeight()+2,
left: e.pageX - ($("#pop-up").outerWidth()+18)
});
}).mouseleave(function() {
$("#pop-up").fadeOut(250);
});
});
</script>
我不确定要设置偏移量,现在图像位于鼠标指针的左上角,我想将它移动到右下角。或者我应该使用jQuery的另一种选择(悬停()?)将鼠标置于左上方到右下方的图像
HTML代码:
<div>
<span id="pop-up" style="position: absolute; display:none;">
<img src="../images/webp01.png" id="re"></span>
<div id="image" style="width:208px; height:318px; margin-left: 150px;"><a href="#">
<img src="../images/webp02.png" border=none /></a></div>
</div>