我对 IE8 中的 .hover() 有一点问题,它在 FF、Chrome 和 Safari 中都可以正常工作。IE 不会给出任何错误或任何错误。这是我到目前为止所拥有的:
- 与 .hover() 一起使用的菜单(适用于 IE8)
- 使用 .hover() 从右侧打开的表单,该表单使用 jQuery Form、jQuery Validate 和 qTip(这适用于除 IE8 之外的所有应用程序)
- 加载了多个 javascript 库:jQuery 1.5.1、jQuery UI、jQuery Form、jQuery Validate、qTip 2、Colorbox
所以这里有问题的代码:
$(document).ready(function () {
//menu works great
$(".menu").hover(
function () {
if(!$(this).hasClass('animated')) {
$(this).dequeue().stop().animate({top: 137}, 400,'easeInOutCirc');
}
},
function () {
$(this).addClass('animated').animate({top: 110}, 400,'easeInOutCirc', function() {$(this).removeClass('animated').dequeue();});
}
);
//this works in everything but IE8
$("#contact-bar").hover(
function () {
if(!$(this).hasClass('animated')) {
$(this).dequeue().stop().animate({right: -10}, 400,'easeInOutCirc', function() {$('.qtip').qtip('show');});
}
},
function () {
$(this).addClass('animated').animate({right: -301}, 400,'easeInOutCirc', function() {$(this).removeClass('animated').dequeue(); $('.qtip').qtip('hide');});
}
);
});
CSS(我尝试更改背景甚至放置图像):
#contact-bar {
position:absolute;
top:282px;
width:352px;
height:360px;
right: -301px;
}
非常感谢任何帮助!