Hack Forums
Can't figure out top dropdown - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Can't figure out top dropdown (/showthread.php?tid=5682490)



Can't figure out top dropdown - FaberCastell - Jul 30, 2017

So basically when you go to the site https://satoshibakery.com/ and then minimize it , in the right bottom you can see that thing, and i would like that when i click it, the dropdown appears

[Image: C6Fe5Nu.png]

ofcourse the html site is already written, but i can't figure out how would i create the code for the top-dropdown that is probably already designed. Any ideas?

I tried just replacing data-target=".top-collapse" with data-target=".sidebar-collapse", but it looks like shit on mobile


* - icmp - Jul 30, 2017

If you're using Bootstrap, see Collapsing The Navigation Bar at the bottom of here
Otherwise, you'd need JS to toggle a mobile menu. Something like (in jQuery);

PHP Code

<?php 
$(document).ready(function(){
   $(
'#idforcollapsebutton').click(function(){
      $(
'#idforhiddenmenu').toggle();
   });
}); 



* - VirtualFrost - Jul 31, 2017

If you're using Bootstrap, do you have jQuery and the bootstrap javascript file both at the bottom of your HTML document? It seems like they aren't linked which would be why nothing is happening when you click on it.