jquery - right position and scroll bar in Firefox -
if animate div position right makes strange movement. happens in firefox, if have div positioned right, , if there scroll bar. why happen , how can solve it?
- only firefox
- right position
- with scrollbar
here example simplified check: http://jsfiddle.net/lhaeh/1/
html:
<div id="blue"></div> <div id="red"></div>
css:
#red { position: fixed; bottom: 20px; right: 25px; width:80px; height:50px; cursor:pointer; background:red; } #blue {/*this div create scroll*/ margin:0 auto; width:80px; height:500px; background:blue; }
jquery:
$(function(){ $("#red").click(function() { $("#red").animate({bottom:'-80px'},1000); }); })
try position: absolute;
.
additional explanation: assume jquery's animate()
changes position absolute
before starting animation, causes firefox move object bit, instead of leaving was.
Comments
Post a Comment