IE-Jquery hover()只在第一次工作
我有一个附加了hover()函数的内联div 它在FF、铬合金中工作良好 问题是IE,第一次有效,第二次我看了div没什么 HTML:IE-Jquery hover()只在第一次工作,jquery,internet-explorer,hover,Jquery,Internet Explorer,Hover,我有一个附加了hover()函数的内联div 它在FF、铬合金中工作良好 问题是IE,第一次有效,第二次我看了div没什么 HTML: 尝试将数字用作不透明度值,而不是显示和隐藏: jQuery("#mini-cart-li").hover( function () { // jQuery(this).addClass('hover'); jQuery("#mini-cart-content").stop(true, true).animate({opaci
尝试将数字用作不透明度值,而不是
显示
和隐藏
:
jQuery("#mini-cart-li").hover(
function () {
// jQuery(this).addClass('hover');
jQuery("#mini-cart-content").stop(true, true).animate({opacity: 1, display: "block"}, "slow");
},
function () {
// jQuery(this).removeClass('hover');
jQuery("#mini-cart-content").stop(true, true).animate({opacity: 0, display: "none"}, "slow");
}
)
试试这个
$('#mini-cart-content').stop(true, true).animate({ opacity: "show" }, "slow");
$("#mini-cart-content").stop(true, true).animate({ opacity: "hide" }, "slow");
你失踪了;在最后})之前;。这很好,所以问题主要在于animate()而不是hover()
jQuery("#mini-cart-li").hover(
function () {
// jQuery(this).addClass('hover');
jQuery("#mini-cart-content").stop(true, true).animate({opacity: 1, display: "block"}, "slow");
},
function () {
// jQuery(this).removeClass('hover');
jQuery("#mini-cart-content").stop(true, true).animate({opacity: 0, display: "none"}, "slow");
}
)
$('#mini-cart-content').stop(true, true).animate({ opacity: "show" }, "slow");
$("#mini-cart-content").stop(true, true).animate({ opacity: "hide" }, "slow");