I have a problem with my dropdown.When I am clicking the dropdown menu button it got opened but when I click on it again the menu gonna moving down and sometimes it is also not able to close my drop down here goes my html code:
<div class="col-md-4 dropdown"><h2 class="dd_text">Vegetables</h2>
<div class="btn-group" id="mydropdown">
<button style="font-size:24px" class="btn btn-light btn-secondary" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><img align="left" src="vegetables.jpg" class="image_on_dd"></img></button>
<div class="dropdown-menu force-scroll" aria-labelledby="dropdownMenuButton">
<label class="pure-material-checkbox">
<input type="checkbox" name="brinjal" value="brinjal"/><span>Brinjal</span></label>
<label class="pure-material-checkbox">
<input type="checkbox" name="potato" value="potato"/><span>Potato</span></label>
<label class="pure-material-checkbox">
<input type="checkbox" name="tomato" value="tomato"/><span>Tomato</span></label>
<label class="pure-material-checkbox">
<input type="checkbox" name="capsicum" value="capsicum"/><span>Capsicum</span></label>
<label class="pure-material-checkbox">
<input type="checkbox" name="onion" value="onion"/><span>Onion</span></label>
Here is my css code:
.btn{
margin-left:30px;
background: white;
border-color:white;
width:300px;
}
.btn:hover{
background: white;
border-color:white;
/*border-bottom-color: gray;*/
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-menu{
width:100%;
}
.force-scroll{
overflow-y: scroll;
width:300px;
}
.dropdown-menu{
transform: translate3d(0px, 85px, 0px)!important;
}
So now I wanted my dropdown should get closed when I double click on the button and get opened when I click once.Is that possible.If?Will anybody help me out?