Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
jquery -10000px bug
<!DOCTYPE html>
<meta charset="utf-8" />
<title>jQuery.animate 10000px bug</title>
<script type="text/javascript" src=""></script>
* I'm trying to animate and change margin-left property of an element
* It works fine under -10000px but it doesnt work >= -10000
* There's a div#bug container which has a red border, and overflow:hidden
* and a div.inner which has width over -10000px
* when i try to animet with margin-left: -10000 i saw TextTextText
* but when tried with margin-left: -99999 it works fine
$(document).ready( function(){
var inner = $("#bug .inner");
$("#marginLeft").click( function(){
"margin-left": "-10000px" //i see TextTextText on every click
// "margin-left": "-10000" //this doesnt work either
// "margin-left": "-9999" //but its not repreduced below 10000px
}, 1000, function() {
<div id="bug" style="width:500px; border:1px dotted #FF0000; overflow:hidden">
<div class="inner" style="width:12000px">
</div> <!-- .inner -->
</div> <!-- #bug -->
<a id="marginLeft" href="#">Animate</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.