A Pen by Sam Matthews on CodePen.
Created
February 25, 2014 23:13
-
-
Save mapsam/9220025 to your computer and use it in GitHub Desktop.
A Pen by Sam Matthews.
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
<ul> | |
<li class="current">about</li> | |
<li>work</li> | |
<li>contact</li> | |
</ul> |
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
$('ul li').click(function() { | |
$('.current').removeClass('current'); | |
$(this).addClass('current'); | |
}); |
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
ul { | |
li { | |
display:inline; | |
background-color:#e5e5e5; | |
padding:20px 30px; | |
position:relative; | |
&:hover { | |
background-color:#c0c0c0; | |
cursor:pointer; | |
&:after { | |
border-top:#c0c0c0; | |
} | |
} | |
&.current { | |
&:after { | |
width: 0; | |
height: 0; | |
border-left: 15px solid transparent; | |
border-right: 15px solid transparent; | |
border-top: 15px solid #e5e5e5; | |
content: " "; | |
position: absolute; | |
bottom: -15px; | |
left: 35%; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment