【发布时间】:2011-04-13 05:52:19
【问题描述】:
我已经编写了几行 jQuery 来根据鼠标移动为 div 向左/向右移动动画
$(".galleryNav").mousemove(function(e){
$("#status").html(e.pageX +', '+e.pageY);
if(e.pageX > 1100 && e.pageX < 1170){
$(".galleryNav").animate({marginLeft:"-60px"},{queue: false, duration: 450});
}
if(e.pageX > 410 && e.pageX < 465){
$(".galleryNav").animate({marginLeft:"10px"},{queue: false, duration: 450});
}
});
它在 Firefox 中运行良好,但在 chrome、safari 或 IE 中没有任何反应。
有什么建议吗?
【问题讨论】:
-
你用的是哪个版本的jQuery?
标签: jquery internet-explorer safari margin jquery-animate