Created
November 12, 2014 11:12
-
-
Save Usse/96549014b695f18e6273 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/codunubogu
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
* { | |
font-family: 'Open Sans', sans-serif; | |
} | |
ul.primary-menu { | |
margin: 30px; | |
float: left; | |
border-bottom: 1px solid #ccc; | |
padding: 0 50px; | |
list-style-type: none; | |
} | |
ul.primary-menu li { | |
float: left; | |
} | |
ul.primary-menu a { | |
position: relative; | |
top: 1px; | |
display: block; | |
text-decoration: none; | |
color: #333; | |
padding: 10px 20px; | |
border-left: 1px solid white; | |
border-right: 1px solid white; | |
border-top: 1px solid white; | |
border-radius: 2px 2px 0 0; | |
} | |
ul.primary-menu a span { | |
float: left; | |
display: block; | |
width: 5px; | |
height: 23px; | |
margin-right: 6px; | |
background: #ccc; | |
} | |
ul.primary-menu a.active { | |
border: 1px solid #ccc; | |
border-bottom: 1px solid white; | |
} | |
ul.primary-menu a.active span { | |
transition: ease-out all 400ms; | |
background: orange; | |
} | |
</style> | |
</head> | |
<body> | |
<ul class="primary-menu"> | |
<li> | |
<a href="#"><span></span>Home</a> | |
</li> | |
<li> | |
<a href="#" class="active"> | |
<span></span> | |
Reference Library | |
</a> | |
</li> | |
<li> | |
<a href="#"><span></span>Events</a> | |
</li> | |
</ul> | |
<script id="jsbin-javascript"> | |
var navigation = { | |
firstLevel: function () { | |
$(".primary-menu li a").on('click', function (e) { | |
e.preventDefault(); | |
$(".primary-menu li a").removeClass('active'); | |
$(this).addClass('active'); | |
}); | |
} | |
}; | |
$(document).ready(function () { | |
navigation.firstLevel(); | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//code.jquery.com/jquery-1.11.1.min.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<ul class="primary-menu"> | |
<li> | |
<a href="#"><span></span>Home</a> | |
</li> | |
<li> | |
<a href="#" class="active"> | |
<span></span> | |
Reference Library | |
</a> | |
</li> | |
<li> | |
<a href="#"><span></span>Events</a> | |
</li> | |
</ul> | |
</body> | |
</html></script> | |
<script id="jsbin-source-css" type="text/css">*{ | |
font-family: 'Open Sans', sans-serif; | |
} | |
ul.primary-menu { | |
margin:30px; | |
float:left; | |
border-bottom:1px solid #ccc; | |
padding:0 50px; | |
list-style-type:none; | |
li {float:left;} | |
a { | |
position:relative; top:1px; display: block; | |
text-decoration:none; color:#333; padding:10px 20px; | |
border-left:1px solid white; | |
border-right:1px solid white; | |
border-top:1px solid white; | |
border-radius:2px 2px 0 0; | |
span { | |
float: left; display: block; width:5px; height:23px; | |
margin-right:6px; background:#ccc; | |
} | |
&.active { | |
border:1px solid #ccc; | |
border-bottom:1px solid white; | |
span { | |
transition: ease-out all 400ms; background:orange; | |
} | |
} | |
} | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var navigation = { | |
firstLevel: function () { | |
$(".primary-menu li a").on('click', function (e) { | |
e.preventDefault(); | |
$(".primary-menu li a").removeClass('active'); | |
$(this).addClass('active'); | |
}); | |
} | |
}; | |
$(document).ready(function () { | |
navigation.firstLevel(); | |
});</script></body> | |
</html> |
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
* { | |
font-family: 'Open Sans', sans-serif; | |
} | |
ul.primary-menu { | |
margin: 30px; | |
float: left; | |
border-bottom: 1px solid #ccc; | |
padding: 0 50px; | |
list-style-type: none; | |
} | |
ul.primary-menu li { | |
float: left; | |
} | |
ul.primary-menu a { | |
position: relative; | |
top: 1px; | |
display: block; | |
text-decoration: none; | |
color: #333; | |
padding: 10px 20px; | |
border-left: 1px solid white; | |
border-right: 1px solid white; | |
border-top: 1px solid white; | |
border-radius: 2px 2px 0 0; | |
} | |
ul.primary-menu a span { | |
float: left; | |
display: block; | |
width: 5px; | |
height: 23px; | |
margin-right: 6px; | |
background: #ccc; | |
} | |
ul.primary-menu a.active { | |
border: 1px solid #ccc; | |
border-bottom: 1px solid white; | |
} | |
ul.primary-menu a.active span { | |
transition: ease-out all 400ms; | |
background: orange; | |
} |
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
var navigation = { | |
firstLevel: function () { | |
$(".primary-menu li a").on('click', function (e) { | |
e.preventDefault(); | |
$(".primary-menu li a").removeClass('active'); | |
$(this).addClass('active'); | |
}); | |
} | |
}; | |
$(document).ready(function () { | |
navigation.firstLevel(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment