Skip to main content

Bug Tracker

Side navigation

#6755 closed bug (worksforme)

Opened July 02, 2010 06:48AM UTC

Closed October 03, 2010 01:54PM UTC

width() and height() function failure

Reported by: dbzprogrammer Owned by:
Priority: undecided Milestone: 1.4.3
Component: dimensions Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

I've been developing a slideshow for a contracted project, and I've found that the width() and height() function set the style attribute for the selected elements. This is fine; however, it seems that once the style attribute is set, width() and height() won't search any deeper than the elements blank style attribute for CSS styles.

Scenario:

I retrieve the height of an element with height() and the style tag becomes set to "", though the CSS class has plenty of stylization (including height). I later go to call height() again, and I get 0 for the height. The style attribute may have other CSS styles set, such as width, position, or display.

I've found a workaround, but I figured I'd let you guys know.

Thanks.

Attachments (0)
Change History (1)

Changed October 03, 2010 01:54PM UTC by addyosmani comment:1

priority: → undecided
resolution: → worksforme
status: newclosed

I've created a live test case outputting both the values obtained for height() and width() but also those for the direct style attributes related to these here: http://jsfiddle.net/sVXHw/1/

As you can see (test FF, Chrome, Safari, IE) here there are no problems in retrieving the height at any point. You can click the div as many times as you want or execute additional functions later on but you'll still be able to retrieve the values of these attributes.

There may be an issue with the code you're writing for your slideshow. If you would like additional assistance in figuring out what the cause may be, please feel free to make a post in the forums.

Thanks!