Skip to main content

Search and Top Navigation

#3090 closed bug (duplicate)

Opened July 11, 2008 02:55AM UTC

Closed July 11, 2008 06:57AM UTC

when margins are set to auto in IE, height and width fail to calculate throwing an NaN

Reported by: jason@walljm.com Owned by: scottgonzalez
Priority: major Milestone:
Component: ui.dialog Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

when the dialog is created and/or resized, the width and height of certain divs in the dialog are set explicitly. the width/height are calculated, compensating for the margins.

when the margins are retrieved, and if they are set to "auto", when parseint is called, it returns a "NaN". when it then tries to do the math... it ends up with a value that looks like this: "NaNpx"

which jquery won't accept when it tries to set the style attribute, which means the height/width doesn't get set.

... if i test for this and set those margins to 0 if they aren't a number then i get weird results

code:

size: function() {

var container = this.uiDialogContainer,

titlebar = this.uiDialogTitlebar,

content = this.element,

tbMargin = parseInt(content.css('margin-top')) + parseInt(content.css('margin-bottom')),

lrMargin = parseInt(content.css('margin-left')) + parseInt(content.css('margin-right'));

if (isNaN(tbMargin)) {tbMargin = 0;}

if (isNaN(lrMargin)) {lrMargin = 0;}

content.height(container.height() - titlebar.outerHeight() - tbMargin);

content.width(container.width() - lrMargin);

},

This only fails on IE 6 (the only place i've encountered the problem.)

Attachments (0)
Change History (1)

Changed July 11, 2008 06:57AM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Duplicate of #3086.