jimmyyami Posted June 13, 2007 Share Posted June 13, 2007 the table is default open, it gonna hide when user click "". the problem is,... how to set it default close?? ##TOGGLE() <script language="javascript"> var ie4 = false; if(document.all) { ie4 = true; } function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } } function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId); if (lText == '') { link.innerHTML = '^-^'; d.style.display = 'block'; } else { link.innerHTML = ''; d.style.display = 'none'; } } </script> . . . . . . . . . . . <? headercat("$lang[Cap_categories] [<a title=\"show/hide\" class=\"hidelayer\" id=\"exp1102170166_link\" href=\"javascript: void(0);\" onclick=\"toggle(this, 'exp1102170166');\">^-^</a>]");?> <div id="exp1102170166"> <table width="100%" border="0" cellspacing="1" cellpadding="2" class="bordercat"> <? $getCats = mysql_query("SELECT ............ WHERE .......... ORDER BY theorder,name"); while ($catBrowse=mysql_fetch_array($getCats)) { $nbSubCats = getSqlNumber("SELECT id FROM probid_categories WHERE parent='".$catBrowse['id']."'"); if ($nbSubCats>0) $catLink=$path.processLink('categories', array('category' => $c_lang[$catBrowse['id']], 'parent' => $catBrowse['id'], 'show' => 'subcats')); else $catLink=$path.processLink('categories', array('category' => $c_lang[$catBrowse['id']], 'parent' => $catBrowse['id'])); ?> <tr> <td class="contentfont"><img src="themes/<?=$setts['default_theme'];?>/img/arrow.gif" hspace="3" align="absmiddle"><a href="<?=$catLink;?>" <? echo ($catBrowse['hover_title']!="") ? "title=\"".$catBrowse['hover_title']."\"":""; ?>><? echo $c_lang[$catBrowse['id']];?> <? if (eregi('Y', $setts['enable_cat_counters'])) echo ($catBrowse['items_counter']!=0) ? "(<strong>".$catBrowse['items_counter']."</strong>)":"(".$catBrowse['items_counter'].")";?> </a> </td> </tr> <? } ?> </table> </div> [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
quickstopman Posted June 13, 2007 Share Posted June 13, 2007 why exactly did u put this in the PHP section? if its about JS? Quote Link to comment Share on other sites More sharing options...
jimmyyami Posted June 13, 2007 Author Share Posted June 13, 2007 anybody knows???? Quote Link to comment Share on other sites More sharing options...
nogray Posted June 14, 2007 Share Posted June 14, 2007 Change the text inside the link to and add style="display:none;" to the div Quote Link to comment Share on other sites More sharing options...
jimmyyami Posted June 15, 2007 Author Share Posted June 15, 2007 OH!!~~ i'll try it immediately tonight. and no matter it succeed or not, I Love you!!! ~~~ "nogray" Quote Link to comment Share on other sites More sharing options...
jimmyyami Posted June 15, 2007 Author Share Posted June 15, 2007 Thanks you a lot!! I did it!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.