JQuery: Problem in getting element's width in Chrome
- by Sarfraz
Hello,
Suppose I have this image:
<img src="images/01.jpg" border="0" rel="shadow" />
Then with JQuery, I get its width using:
$('[rel="shadow"]').width();
Firefox and IE report correct dimensions of the image eg 140px while Chrome reports 0. How to solve this problem?
Note:
I don't want to set explicit width for images eg:
<img src="images/01.jpg" border="0" rel="shadow" width="140" />
So, how to get width in cross-browser way which is not defined in width attribute of elements?
Thanks