Created
November 7, 2014 14:05
-
-
Save user24/b6ae2948a7941eafe5a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#calendar .barIcons > .barIcon').each(function (i, icon) { | |
var left; | |
icon = $(icon); | |
left = parseInt(icon.position().left, 10); | |
alert(left); // increases each time | |
return; // Comment this and now the alert is zero each time. | |
icon.css({ | |
"position": "absolute" | |
}); | |
}); |
@getify yeah I know console.log can be async - didn't think alert could. But even then, it is actually setting the values to zero too, even without the alert.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(The CSS and structure of the page shouldn't even make a difference - I just can't see how the position().left could POSSIBLY be affected by the position: absolute; it's value must have been resolved BEFORE the position absolute is applied.)