I'm currently working on a website that includes a settings feature with a button. My goal is to have the options and other links display in a dropdown menu when hovered over. Although I have written what I believe to be the correct code, it's not functioning as expected.
Here is the Javascript, CSS, and HTML code I'm using:
$(document).ready(function(){
$('#settings').mouseenter(function(){
$('#settingDrop').css('visibilty', 'visible');
});
$('#settingDrop, #settings').mouseleave(function(){
$('#settingDrop').css('visibilty', 'hidden');
});
});
#settings {
width: 40px;
background-image: url(http://cdn.flaticon.com/png/256/23171.png);
background-repeat: no-repeat;
background-size: 40px 40px;
background-color: #F0F0F0;
bottom: 0px;
position: relative;
height: 30px;
background-position: center;
float:left;
}
#settingDrop {
position: absolute;
width: 200px;
height: 300px;
background-color: #F0F0F0;
float:left;
top:55px;
visibility: hidden;
}
.navbar {
margin-left:
width: 170px;
padding: 10px 5px 10px 5px;
text-align: center;
display: inline-block;
margin-right: 30px;
height: 30px;
}
<div id = 'settings' class='navbar'></div>
<div id = 'settingDrop'></div>