<div style="left: 100%"></div>
parseInt($("div").css("left"), 10);
When I try to get value of left
, some browsers give result in pixels, some in %.
Here is an example http://jsfiddle.net/WTt4s/1/
Google Chrome gives percent value, IE9 gives pixels instead.
How do I get the same value in all browsers (px or %)?
Try this one parseInt($("div")[0].style.top, 10)
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