Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

NEED URGENT HELP (Making a Dropdown Menu within a Template!!)

Hey,

I'm working with this template: https://w3layouts.com/preview/?l=/gym-fl...-template/ it is Bootstrap based.

This is the Menu I have at the moment: [Image: 150bdf951a.png]

I want that the text "Afdelingen" is a dropdown button which shows 3 options. but I can't seem to find a way to do it. I tried to do this:

Code
<li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>

But it didnt do anything. It is really urgent so please HMU if you know how to fix it. I have Skype and Discord. Can do with Teamviewer.
CSS
Code
.dropdown-toggle parent {
    cursor:pointer;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    margin-top: 0;
}
HTML
Code
<li class="dropdown">
  <a data-toggle="dropdown" class="dropdown-toggle">Afdelingen</a>
  <ul class="dropdown-menu" id="menu1">
    <li><a href="#">Afdeling Noord</a></li>
    <li><a href="#">Afdeling Zuid</a></li>
    <li><a href="#">Afdeling West</a></li>
  </ul>
</li>
result
[Image: d4ead24750a749a250cc332a94e76876.gif]
FS Webdeveloper
Ahh you beat me to it. But yeh you dont even need to add the styles that Steezy has added just simply add another <ul> inside of the <li> you want to drop down. Like this
Code
<li><a href="trainers.html">Trainers</a></li>
               <li><a href="classes.html">Classes</a>
                       <ul>
                           <li><a href="classes.html">Classes</a></li>
                           <li><a href="classes.html">Classes</a></li>
                           <li><a href="classes.html">Classes</a></li>
                           <li><a href="classes.html">Classes</a></li>
                       </ul>
               </li>
               <li><a href="blog.html">Blog</a></li>
(Aug 19, 2016 10:22 AM)SteezyHB Wrote:  CSS
Code
.dropdown-toggle parent {
    cursor:pointer;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    margin-top: 0;
}
HTML
Code
<li class="dropdown">
  <a data-toggle="dropdown" class="dropdown-toggle">Afdelingen</a>
  <ul class="dropdown-menu" id="menu1">
    <li><a href="#">Afdeling Noord</a></li>
    <li><a href="#">Afdeling Zuid</a></li>
    <li><a href="#">Afdeling West</a></li>
  </ul>
</li>
result
[Image: d4ead24750a749a250cc332a94e76876.gif]

Wow, bedankt man! <3
(Aug 19, 2016 10:34 AM)Jdxo Wrote:  Ahh you beat me to it. But yeh you dont even need to add the styles that Steezy has added just simply add another <ul> inside of the <li> you want to drop down. Like this

You do need these styles
Code
.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    margin-top: 0;
}
Doesn't seem to be working without these css classes;
The first one is required for the dropdown menu to actually show (otherwise it'll stay hidden on dropdown button hover), and the second is so that you can actually reach the dropdown menu without it dissapearing (because you're not hovering either the dropdown button or the dropdown menu).
edit: only on my version, just tested out your html code and it seems to be working (would still need some styling though; https://gyazo.com/d3c6838ac814ab657adc9258b6ebdff4 )
(Aug 19, 2016 10:36 AM)Frankey Wrote:  Wow, bedankt man! <3
geen probleem ;)
FS Webdeveloper


Possibly Related Threads...
Thread / Author Replies Views Last Post
by OlympusSep 21, 2018 08:01 AM 2 176 Sep 21, 2018 08:01 AM
Last Post: gua
by FaberCastellJul 31, 2017 03:21 AM 2 162 Jul 31, 2017 03:21 AM
Last Post: VirtualFrost
by Makaveli.May 9, 2016 04:22 PM 11 192 May 9, 2016 04:22 PM
Last Post: comp