在 IE 中使用 '+=' 动画的 Jquery 问题

标签 jquery css animation

谁能帮我解决为什么这在 IE 中不起作用? 我有一张产品照片,当翻过它时,它会向下移动以释放其下方的更多信息。 这适用于所有其他浏览器,但不适用于 IE < 7 有什么想法或其他解决方案吗?

目前悬停效果正常工作,但“滚动”在 IE 中没有任何作用 谢谢

$('#topProducts li').hover(
function () {
    $(this).find('.topProdImg').stop().animate({
        bottom: '-=140'
    }, 500)
}, function () {
    $(this).find('.topProdImg').stop().animate({
        bottom: '+=0'
    }, 500)
});

CSS:

.topProducts ul li img{
    position:absolute;
    z-index:10;
    padding-bottom:10px;
    border-bottom:1px #ebebeb solid;
    left: 20px;
}

谢谢

最佳答案

尝试使用px

$('#topProducts li').hover(
function () {
    $(this).find('.topProdImg').stop().animate({
        bottom: '-=140px'
    }, 500)
}, function () {
    $(this).find('.topProdImg').stop().animate({
        bottom: '0px' //it doesn't sense to apply +=0
    }, 500)
});

关于在 IE 中使用 '+=' 动画的 Jquery 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21299115/

相关文章:

javascript - Jquery - 在 HTML 代码中动态生成字符串?

javascript - 动态加载的元素没有在下拉列表中第二次显示(Harvest Hq Chosen)

html - 基金会导航栏问题

python - Kivy自定义动画函数

arrays - 如何将文件夹中的图像添加到我的 swift 代码中?

java - 在 Android 中合并两个动画

javascript - 选择一组 CSS 选择器中的第一个元素

jquery - 缩略图悬停时的新图像

jquery - 使用 javascript 将 Base64 图像上传到 Google 云端硬盘

jquery - jquery 对话框关闭时页面滚动消失