Skip to content

Instantly share code, notes, and snippets.

@nealnote
Last active August 29, 2015 14:01
Show Gist options
  • Save nealnote/b058d9e054bbdc4a3317 to your computer and use it in GitHub Desktop.
Save nealnote/b058d9e054bbdc4a3317 to your computer and use it in GitHub Desktop.
css transition
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>transition</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/base-min.css">
<style type="text/css">
.sc {
margin-top: .6em;
text-align: center;
letter-spacing: .8em;
}
.item {
transition: 1s;
display: inline-block;
width: 120px;
height: 120px;
background: #16a085;
margin: 0 -68px;
}
</style>
</head>
<body>
<div class="sc">
<i class="item"></i>
<i class="item"></i>
<i class="item"></i>
</div>
<button type="button" id="btn">button</button>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$('#btn').on('click', function(){
$('.item').css({'margin':'0 60px'});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment