Re: [jQuery] Problems getting border width

2006-09-10 Thread Jan Sorgalla
dave.methvin wrote: > > Now the question is, should .css() return a string with units or other > special name, and .curCSS always return pixels as a number (instead of a > string)? Or should we do it some other way? > Shouldnt it be the opposite way since at the moment, .css return width and

Re: [jQuery] Problems getting border width

2006-09-10 Thread Dave Methvin
> 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 Wow, I missed that...it's like the same swap trick John used to get element width and height. This should also work for padding, but not fo

Re: [jQuery] Problems getting border width

2006-09-09 Thread Jan Sorgalla
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.co

Re: [jQuery] Problems getting border width

2006-09-09 Thread John Resig
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

Re: [jQuery] Problems getting border width

2006-09-09 Thread Dave Methvin
As John says, the situation with getting border dimensions on elements is a mess (like margin and padding) and there are limits to the amount of lipstick jQuery can put on this pig. Here are the results of my experiments with jQuery().css() on IE6, IE7RC1, FF1.5, and Opera 9.1. 1) The shortcut pro

Re: [jQuery] Problems getting border width

2006-09-09 Thread Stefan Petre
How do you plan to use innerHeight and innerWidth ? If an element has padding and border, a child element with position top: 0, left: 0 will not be placed right next to border. The padding counts too. Paul Bakaus wrote: > Hi there, > > I will look at this problems for the new core plugin dimensi

Re: [jQuery] Problems getting border width

2006-09-09 Thread Jan Sorgalla
Paul Bakaus wrote: > > I will look at this problems for the new core plugin dimensions.js. > Getting > the calculated style property is always a bit of a hassle. Right now, > $().outerHeight will give you the correct offset height including padding > and border (hopefully cross-browser), but I h

Re: [jQuery] Problems getting border width

2006-09-08 Thread John Resig
> It does seem like a jQuery bug that .css("border") returns undefined on IE > instead of an empty string. That is completely browser dependent. Since a border style has not been defined, it is fully within the browsers "right" to return "undefined" as its value. > If nobody else is chasing this

Re: [jQuery] Problems getting border width

2006-09-08 Thread John Resig
> I wonder if jQuery should provide a x-browser way of doing this. Upon > superficial inspection, it seemed to me that you're accessing the "style" > attribute, not the current/computed styles. jQuery deals exclusively with the computedStyle functions for getting style - so if anything strange is

Re: [jQuery] Problems getting border width

2006-09-08 Thread Paul Bakaus
Hi there,I will look at this problems for the new core plugin dimensions.js. Getting the calculated style property is always a bit of a hassle. Right now, $().outerHeight will give you the correct offset height including padding and border (hopefully cross-browser), but I haven't tested these speci

Re: [jQuery] Problems getting border width

2006-09-08 Thread Jan Sorgalla
dave.methvin wrote: > > If nobody else is chasing this I can look at it tonight. > Would be great, i'm also trying to get deeper into it... Jan -- View this message in context: http://www.nabble.com/Problems-getting-border-width-tf2239933.html#a6214174 Sent from the JQuery forum at Nabble.c

Re: [jQuery] Problems getting border width

2006-09-08 Thread Jan Sorgalla
Francisco Brito wrote: > > hmm, I can think of using currentStyle (IE) and getComputedStyle (FX), but > I > don't know what to use for Safari et al. > > I wonder if jQuery should provide a x-browser way of doing this. Upon > superficial inspection, it seemed to me that you're accessing the "sty

Re: [jQuery] Problems getting border width

2006-09-08 Thread Dave Methvin
> I just ran into a problem getting the border width from elements. > This isn't a specific jQuery problem ... I don't know, there are some unusual things going on there. I added a few things to your demo and this was the IE result: This is #div1 jQuery(s).css("border"): undefined (undefined) s

Re: [jQuery] Problems getting border width

2006-09-08 Thread Francisco Brito
hmm, I can think of using currentStyle (IE) and getComputedStyle (FX), but I don't know what to use for Safari et al.I wonder if jQuery should provide a x-browser way of doing this. Upon superficial inspection, it seemed to me that you're accessing the "style" attribute, not the current/computed st

[jQuery] Problems getting border width

2006-09-08 Thread Jan Sorgalla
I just ran into a problem getting the border width from elements. This isn't a specific jQuery problem but might end up in an improvment...). I need to get the exact width of an element (width+padding+margin+border). So, i discovered some strange results while retrieving the border width. I've se