Plugins

User login
Can't find a Plugin?

Can't find a Plugin you are looking for? Check out the jQuery Wiki page.

Are you a plugin developer? Please move your plugin over to this site.

Website Bug or Feature Request?

Found a bug on the new jQuery Plugin website? Have a feature request?

Submit it to the jQuery Plugin website issue queue to ensure it is noticed!

width()/height() calculations not equal to jQuery's internal width()/height()


Project:Dimensions
Version:1.2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The dimensions plug-in uses the following to calculate width/height:

num( this, name.toLowerCase() )

The num() function looks like:

function num(el, prop) {
return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
};

The problem is that if the element is not visible, the calculation is wrong. The internal jQuery css() function has code that correctly calculates the width()/height().

I'd suggest using the css() method instead of curCSS() when calculating either the width() or height() of an element.