Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created June 1, 2012 23:17
Show Gist options
  • Save eduardolundgren/2855699 to your computer and use it in GitHub Desktop.
Save eduardolundgren/2855699 to your computer and use it in GitHub Desktop.
trash icon
<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