css jquery位置固定元素在右边。在Firefox中激活BUG [英] css jquery position fixed element on the right. animate BUG in Firefox

查看:112
本文介绍了css jquery位置固定元素在右边。在Firefox中激活BUG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



小提琴



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

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

$('。up')。animate({
bottom:'0%'
} ,1000,function(){
$(this).removeClass('up');
});
});

Firefox中有一个错误(我的版本:19.0.2)。



当你点击红色按钮,它跳到右边(距离正好是滚动条的宽度)。
当它在右边,你调整窗口(或小提琴框架)的大小,它跳回。



我做错了什么?有没有好的解决方案来修复它?

解决方案

很好,如果你改变width属性, p>

请尝试此



更改

 code> width:100px 

  min-width:100px; 

希望它有帮助。


I created a fiddle for my question:

fiddle

$('#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');
    });
});

There is a bug in Firefox (my version: 19.0.2).

When you click the red button, it jumps to the right (distance has exactly the width of the scrollbar). when it is on the right and you resize the window (or fiddle-frame) it jumps back.

Am I doing anything wrong? Is there a good solution to fix it?

解决方案

well if you change the width property then it works fine even on firefox

try this

change

width:100px 

to

min-width:100px;

Hope it helps.

这篇关于css jquery位置固定元素在右边。在Firefox中激活BUG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆