css jquery位置固定元素在右边.在Firefox中动画BUG

Joh*_*ith 5 css firefox jquery

我为我的问题创造了一个小提琴:

小提琴

$('#move').click(function (e) {
    e.preventDefault();

    $(this).not('.up').animate({
        bottom: '50%'
    }, 1000, function () {
        $(this).addClass('up');
    });

    $('.up').animate({
        bottom: '0%'
    }, 1000, function () {
        $(this).removeClass('up');
    });
});
Run Code Online (Sandbox Code Playgroud)

Firefox中存在一个错误(我的版本:19.0.2).

单击红色按钮时,它会向右跳转(距离恰好是滚动条的宽度).当它在右边并且你调整窗口(或小提琴框架)的大小时它会跳回来.

我做错了吗?有没有一个很好的解决方案来解决它?

小智 11

好吧,如果您更改宽度属性,那么它甚至在Firefox上工作正常

试试这个

更改

width:100px 
Run Code Online (Sandbox Code Playgroud)

min-width:100px;
Run Code Online (Sandbox Code Playgroud)

希望能帮助到你.