Bug Tracker

Ticket #11266 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

toggle() does not work on col or colgroup

Reported by: OBCENEIKON Owned by:
Priority: low Milestone: None
Component: css Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

jQuery Version: 1.7.1

Browser: Safari 5.1.2 (7534.52.7)

OS: Mac OS X 10.7.2 Build 11C74

Toggling a column does not work on a colgroup.

 http://jsfiddle.net/zLJvS/

Clicking "Hide Cells" should make the red cells disappear, but instead hides just the cells and applies the col and colgroup to the remaining cell.

Change History

comment:1 Changed 3 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to css

This is not a jQuery issue. I think the browser is getting confused by the placement of "this_class" on the cols, which is unnecessary.

 http://jsfiddle.net/zLJvS/4/

comment:2 Changed 3 years ago by OBCENEIKON

Even after your change, removing this_class from the col elements, the colgroup is still displaying. The third column should not be a red color after hiding the first two columns.

I did find a way to make the colgroup hide and that was to set the visibility to collapse and display none.

Example:  http://jsfiddle.net/zLJvS/5/

comment:3 Changed 3 years ago by dmethvin

Since .toggle() is about toggling the visibility of target elements and col/colgroup elements are never visible, I'm not even sure it's a valid use case. Using a class name is probably better.

comment:4 Changed 3 years ago by timmywil

Browsers probably differ on whether to apply the rules of a colgroup to their respective columns when display is none. The 3rd column is not red in Chrome in my fiddle. Regardless of whether my assumption was correct, this is really not something jQuery can tackle.

Note: See TracTickets for help on using tickets.