I agree, great analysis. Thats exactyl what i tried put into words but
couldnt in my poor english. Did you noticed my solution i posted as reply
one of Pauls's posts?
I found a solution to get the border width in pixels independent from how
its assigned.
Check the source code at http://sorgalla.com/test/borders.html

The key is extending jQuery.css() with:

if ( p == "borderTopWidth" || p == "borderRightWidth" || p ==
"borderBottomWidth" || p == "borderLeftWidth" ) {
    var old = {}, oHeight, oWidth;

    old[p] = 0;
    jQuery.swap( e, old, function() {
        oHeight = e.offsetHeight;
        oWidth = e.offsetWidth;
    });

    return p == "borderTopWidth" || p == "borderBottomWidth" ?
e.offsetHeight - oHeight : e.offsetWidth - oWidth;
}

Jan


John Resig wrote:
> 
> This is a great analysis Dave - and spot on. Most of .curCSS()
> originated back from stuff on QuirksMode.org - which is to say that
> it's acceptable, but not perfect. If I were to give you a SVN account,
> would you be willing to make some of these changes (e.g. remove the
> need for elem.style, swap the order of getComputedStyle/currentStyle).
> 
> I'm debating what to do about the borderWidth issue, though - since
> jQuery does access that property too, in $.css(). I hate having
> special cases for properties, but perhaps it would be 'ok' to have a
> built in check to see if borderPositionStyle is 'none' before going
> any further.
> 
> Contact me off-list if you'd like to help me with this.
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-getting-border-width-tf2239933.html#a6228418
Sent from the JQuery forum at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to