javascript - how to hide table when html page opens -
hallo there have javascript code allowing table visible when mouse passes on link , hide when mouse moves out. problem have have table 'hidden' when page opens. how achieve this. code hiding , showing of table.
<li onmouseout="hidemenu('families')" onmouseover="showmenu('families')" ><a href="#">five families</a> <table class="slidedownone" id="families" width="120px" border="1px" cellpadding="5px 0px 5px 0px"> <tr><td><a href="#">gambino</a></td></tr> <tr><td><a href="#">genovese</a></td></tr> <tr><td><a href="#">colombo</a></td></tr> <tr><td><a href="#">bonnano</a></td></tr> <tr><td><a href="#">luchhese</a></td></tr> </table> </li> and javascript code used hiding , showing of table
<script language="javascript"> function showmenu(elmnt) { document.getelementbyid(elmnt).style.visibility="visible"; } function hidemenu(elmnt) { document.getelementbyid(elmnt).style.visibility="hidden"; } </script> regards arian
you need apply same css applying via javascript table itself:
#families { visibility:hidden } or, using inline css:
<table style="visibility:hidden" class="slidedownone" id="families" width="120px" border="1px" cellpadding="5px 0px 5px 0px"> ... </table> note using visibility property, element still take space in document. if don't want that, need display property instead:
#families { display:none }
Comments
Post a Comment