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? Link to comment https://forums.phpfreaks.com/topic/83144-attach-menu-onclick/ 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> Link to comment https://forums.phpfreaks.com/topic/83144-attach-menu-onclick/#findComment-422962 Share on other sites More sharing options...
Mr.Shawn Posted December 26, 2007 Author Share Posted December 26, 2007 Thanks. it works. Link to comment https://forums.phpfreaks.com/topic/83144-attach-menu-onclick/#findComment-423164 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? Link to comment https://forums.phpfreaks.com/topic/83144-attach-menu-onclick/#findComment-424030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.