PDA

View Full Version : Switch content from <tr> in Switch Content II



voggers
04-14-2006, 10:52 PM
Hi!

I just started playing around with the Switch Content II script...and i was wondering if anyone have managed to make it work by clicking anywhere in the <tr> instead of just the + or - sign.
Currently i've only managed to make it switch without the + and - signs changing.....(well they do change, but opposite of what they are intended to do):


<tr class="padd" onClick="expandcontent(this,'sc1')" style="cursor:hand; cursor:pointer">

I guess the 'this' would be wrong here?

jscheuer1
04-15-2006, 03:26 AM
Using a table row with this script is highly unreliable, especially in IE. Much better to use a table cell. If you want it to be a table row, use a row with one cell. If you want cells within that row, nest another table in the single celled row's cell.

This is also true of the expanding content (sc1, sc2, etc.). Use cells or divisions in cells. The table row is a special case and generally should never have any content other than a cell(s).