Actually the the latest Dimensions plugin and the jQuery 1.0.4 core both return the exact same thing, a string.
-- Brandon Aaron On 1/1/07, Abel Tamayo <[EMAIL PROTECTED]> wrote: > Hi everyone and Happy New Year 2007. I'm using Kevin Luck's jScrollPane > plugin (http://kelvinluck.com/assets/jquery/jScrollPane/ ), > wich is great stuff but uses the plug in Dimensions wich overrides jQuery's > functions height() and width(). The diference between the two namespaces is > that when you use this functions to obtain the dimensions of an object (ie: > $("#content").width() ) jQuery returns an "integer" like 200, but Dimensions > returns a "string" like 200px. > The problem is that I use this functions a lot to format my page's layout > but I need to use the result in numeric expressions adding, substracting, > etc and it can't be done if the result is not a number so I need to extract > the px out of the string. I was considering using a expression like > > var newWidth = oldWidth.substring(0,indexOf("p")-1); > > or even > > var newWidth = oldWidth.replace(/px/,""); > > but I could use some input about how you guys get around this issue the easy > and fast way, since my page uses already a lot of script and I don't want to > burden it even more. > Thanks. > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
