Not sure on this but...
I believe that's because .css() - in the case of IE - returns the
element.currentStyle value which is exactly the same as what the
stylesheet says. In other browsers,
document.defaultView.getComputedStyle is used which computes the actual
pixel value of what it returns based on what the stylesheet says.
-blair
Arrix wrote:
> html: <div id="div1">Hello</div>
>
> JavaScript: $(function() {
> alert($('#div1').css('height') + ' ' + $('#div1').height() + ' ' +
> $.css($('#div1')[0], 'height'));
> });
>
> The result is as follows
>
> Firefox: 19px 19 19
> Opera: 19px 19 19
> IE: auto 19 19
>
> Why is $(ele).css('height') in IE different? Is this a bug or by design?
> --
> Arrix
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/