Last active
August 29, 2015 14:01
-
-
Save nealnote/b058d9e054bbdc4a3317 to your computer and use it in GitHub Desktop.
css transition
This file contains 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> | |
<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