Opened 11 years ago
Closed 11 years ago
#12243 closed bug (fixed)
$("col").width() returns 0
Reported by: | Owned by: | mikesherov | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | dimensions | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
It seems that width(), outerWidth() and css("width") no longer work for col elements. Zero is always returned. Here is the repro: http://jsbin.com/ilejan/1/edit
Change History (5)
comment:1 Changed 11 years ago by
Component: | unfiled → dimensions |
---|---|
Owner: | set to mikesherov |
Priority: | undecided → low |
Status: | new → assigned |
comment:3 Changed 11 years ago by
I have a similar issue: http://jsfiddle.net/eZLLU/
If you remove the div tag or if you use jQuery 1.7.2, width is reported correctly.
comment:4 Changed 11 years ago by
nicola: http://stackoverflow.com/questions/1827965/is-putting-a-div-inside-an-anchor-ever-correct While jQuery worked in this case in 1.7.2, it was accidental. It worked because jQuery was changing the style of the a tag to display: block momentarily. This causes undesired and incorrect results elsewhere. Removing the div makes it work again, because you once again have valid HTML.
Long story short: use valid HTML and it works fine.
Fix for col coming shortly.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #12243, $("col").width() should return the column's width. Close gh-916.
Changeset: 670e3ff040b0a7164f36a3c5e07214420b8b09f4
Mike, could you take a look at this?