Mr.Shawn Posted December 25, 2007 Share Posted December 25, 2007 I'm trying to make a button to display a menu below it when clicked. How can I do that? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 25, 2007 Share Posted December 25, 2007 <input type="button" value="Menu 1" onclick="javascript:document.getElementById('submenu').style.display='block'; return true"> <div id="submenu" style="display:none;width:200px;height:150px;border:solid 1px black;position:absolute;margin:0;z-index:1000"> <div style="width:auto;display:block;text-align:right;padding-right:5px;font-size:80%"><a href="javascript:void(0)" onclick="javascript:document.getElementById('submenu').style.display='none'; return true">Close</a></div> <!-- Menu Content Here --> </div> Quote Link to comment Share on other sites More sharing options...
Mr.Shawn Posted December 26, 2007 Author Share Posted December 26, 2007 Thanks. it works. Quote Link to comment Share on other sites More sharing options...
Mr.Shawn Posted December 27, 2007 Author Share Posted December 27, 2007 Hey, how can i make it such that when clicked the button again, it closes the menu or even when clicking on other areas, it closes the menu? 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.