I've tried to build a table collapser yet I've problems with the
statements

  $('#collapser_'+i+', .expanding').bind('click', collapser_collapse
(i));
  $('#collapser_'+i+', .collapsing').bind('click', collapser_expand
(i));

To me they look correct yet Javascript stops working. The source is

  for (var i in data) {
    var d = data[i];
    $('#eintragsliste').append(
      '<tr><td><table id="collapser_'+i+'">' +
      '  <tr>' +
      '    <td width=60 align="center"><img class="expanding"
src="images/plus01.png"><img class="collapsing" src="images/
minus01.png" style="display:none"></th>' +
      '    <td width=240><b>'...</b></td>' +
      '  </tr><tr class="expanded">' +
      '    <td width=60>&nbsp;</td>' +
      '    <td width=240>...</td>' +
      '  </tr>' +
      '</td></tr></table>');
    $('#collapser_'+i+', .expanding').bind('click', collapser_collapse
(i));
    $('#collapser_'+i+', .collapsing').bind('click', collapser_expand
(i));
  }

Sample and full source is at 
http://www.orpatec.ch/termola/index.php?page=orgslist.php

Besides is it possible to add several classes with addClass or does it
replace the existing class?

O. Wyss

Reply via email to