+ 2
Width method in jQuery
Normally width method returns in pixels but some time we added width using CSS like #demo{ width:20% } if we are getting width using jQuery alert($('#demo'). width ()); sometimes it return in present. it's not happen every time but sometimes happens. I faced this issue in my last project so be careful. it maybe helpful for you. Thanks
2 ответов
+ 4
do: style.width
+ 1
sooo...you want to say
If we use width value in % it will not be always returned using JQ in % o.O?
at least with .width ?
how about $(#demo).css('width')?
guess it's better to use css if we wanna get or change css property.
width and height mostly about browser sizes,for example...at least I feel so...
But anyway...ty for info,maybe you just solved my future mistake:)