Created
June 1, 2012 23:17
-
-
Save eduardolundgren/2855699 to your computer and use it in GitHub Desktop.
trash icon
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
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<style> | |
.icon { | |
width: 0; | |
height: 16px; | |
background: red; | |
transition: width .2s; | |
-webkit-transition: width .2s; | |
display: inline-block; | |
position: absolute; | |
} | |
.icon-wide { | |
width: 16px; | |
} | |
</style> | |
<span class="icon" id="icon"></span> <span style="margin:18px;">Test</span> | |
<script> | |
var i = document.getElementById('icon'); | |
document.onclick = function() { | |
i.classList.toggle('icon-wide'); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment