With jquery I wrote the following highly complex code:
val = 100;
n.css('left', val /* + 'px' */);
console.log(val, n.css('left'));
The console output of it is:
100, "90px"
why is that so...?
Thanks in advance for some help
EDIT: Here's an example: http://jsfiddle.net/RaznH/1/ You need to have your browser zoomed out (e.g. with "ctrl -") and the console opened in order to have the effect appear
You need to have a position other than static (relative,absolute or fixed) declared on your element or else it won't work.
Taking the example from the comments: http://jsfiddle.net/VqH9x/1/ everything works fine when you declare a proper position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With