godsent Posted March 27, 2009 Share Posted March 27, 2009 my toggle_div function looks like this: <script type="text/javascript"> <!-- function toggle_div(id) { var diq = document.getElementById(id).style; diq.display=(diq.display=="none") ? "" : "none"; } //--> </script> It hides and shows a div then clicked. <a href="javascript:toggle_div('content')">Hide/show</a> But then you start website, it starts with shown div, how to make that the div would be hiden then website starts. I think this should work but it doesnt: <script type="text/javascript"> <!-- function toggle_div(id) { var diq = document.getElementById(id).style; diq.display=(diq.display=="none") ? "" : "none"; } toggle_div('content'); //--> </script> Please help me if you know how Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted March 27, 2009 Share Posted March 27, 2009 <div style="display:none;"> 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.