Simple jquery dropdown menu
Created
October 3, 2015 09:19
-
-
Save FutureMedia/6108bcd2f6b51fa3ef72 to your computer and use it in GitHub Desktop.
Jquery dropdown menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%nav.dropdown-menu{:role => "navigation"} | |
%a#profileMenu{:href => "#"}Jquery menu | |
%ul#dropdown | |
%li | |
%a.active{:href => "#"} menu item | |
%li | |
%a{:href => "#"} menu item | |
%li | |
%a{:href => "#"} menu item | |
%li | |
%a{:href => "#"} menu item | |
%li | |
%a{:href => "#"} menu item | |
%li | |
%a{:href => "#"} menu item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#profileMenu") | |
.mouseover(function() { | |
$("#dropdown").show(200); | |
}); | |
$(".dropdown-menu") | |
.mouseleave(function() { | |
$("#dropdown").hide(400); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import compass | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,700,700italic) | |
html | |
font-size: 100% | |
font-family: 'Open Sans', sans-serif | |
$primary: rgba(240,45,4, 1.0) | |
$primary-l: rgba(240,85,4, 1.0) | |
$grey-4: rgba(231,231,231, 1.0) | |
$grey-5: rgba(240,240,240, 1.0) | |
.dropdown-menu | |
display: inline-block | |
clear: both | |
overflow: hidden | |
margin: 2rem | |
ul | |
list-style: none | |
margin: 0 | |
padding: 0 | |
display: none | |
min-width: 140px | |
max-width: 240px | |
background: $grey-5 | |
position: relative | |
+border-radius(7px) | |
&::before | |
content: '' | |
width: 0 | |
height: 0 | |
border-style: solid | |
border-width: 0 10px 10px 10px | |
border-color: transparent transparent $grey-5 transparent | |
position: absolute | |
top: -10px | |
left: 20px | |
li | |
font-size: 0.8rem | |
display: block | |
padding: 0 | |
margin: 0 | |
+transition(all .4s) | |
&:nth-of-type(1) | |
+border-radius(7px 7px 0 0 ) | |
&:last-of-type | |
+border-radius(0 0 7px 7px) | |
&:hover | |
background: $grey-4 | |
a | |
padding: 0.7rem 1.4rem | |
text-decoration: none | |
margin: 0 | |
display: inline-block | |
color: $primary-l | |
width: 100% | |
&:hover | |
color: $primary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment