Jump to content

[SOLVED] Toggle() How to default hide the table using toggle()???


jimmyyami

Recommended Posts

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.