JSFiddle - React, Tailwind, and code Playground
by secondfre
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="description" content="description">
<title>Page Title</title>
<link rel="stylesheet" media="screen" href="style.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div id="test">
<ul>
<li class="top"><a href="#">Test One</a><a href="#">Test Two</a></li>
<li class="top"><a href="#">Test One</a><a href="#">Test Two</a></li>
<li class="top"><a href="#">Test One</a><a href="#">Test Two</a></li>
</ul>
</div>
</body>
</html>
CSS
* {
padding: 0;
margin: 0;
}
#test {
height: 100px;
width: 630px;
overflow: hidden;
margin: 50px auto;
text-align: center;
}
#test ul a {
color: white;
display: block;
background: red;
height: 100px;
width: 200px;
font: 2em/100px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
-webkit-transition: margin .4s ease-in-out;
text-decoration: none;
-webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.24);
}
#test ul a:nth-of-type(even) {
background: black;
color: white;
}
#test ul li {
float: left;
margin: 0 5px;
}
#test ul {
list-style-type: none;
}
JavaScript
$(".top").hover(function() {
$(this).stop().animate({ marginTop: "-100px" }, 400);
},function(){
$(this).stop().animate({ marginTop: "0px" }, 400);
});