Created
April 5, 2017 23:12
-
-
Save akiko-pusu/5aa5873fbcc16861e68b569a78ce1106 to your computer and use it in GitHub Desktop.
CSSで:not を使ってみる
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
<a class="icon icon-reload" href="#" | |
title="Revert" id="revert_template" onclick="revertAppliedTemplate();"> | |
Revert | |
</a> | |
<script> | |
function revertAppliedTemplate() { | |
$('#revert_template').toggleClass('disabled'); | |
} | |
</script> | |
<style> | |
#revert_template { | |
display: inline-block; | |
-webkit-transition: .3s ease-in-out; | |
transition: .3s ease-in-out; | |
padding-top: 1px; | |
padding-bottom: 1px; | |
} | |
#revert_template:not(.disabled):hover { | |
-webkit-animation: scale .4s ease-in-out; | |
animation: scale .4s ease-in-out; | |
} | |
@-webkit-keyframes scale { | |
0% { transform: scale(1.0); } | |
25% { transform: scale(1.04); } | |
50% { transform: scale(1.1); } | |
75% { transform: scale(1.04); } | |
100% { transform: scale(1.00); } | |
} | |
@keyframes scale { | |
0% { transform: scale(1.0); } | |
25% { transform: scale(1.04); } | |
50% { transform: scale(1.1); } | |
75% { transform: scale(1.04); } | |
100% { transform: scale(1.00); } | |
} | |
#revert_template.disabled { | |
filter: alpha(opacity=20); | |
-moz-opacity: 0.2; | |
opacity: 0.2; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment