Skip to content

Instantly share code, notes, and snippets.

@akiko-pusu
Created April 5, 2017 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiko-pusu/5aa5873fbcc16861e68b569a78ce1106 to your computer and use it in GitHub Desktop.
Save akiko-pusu/5aa5873fbcc16861e68b569a78ce1106 to your computer and use it in GitHub Desktop.
CSSで:not を使ってみる
<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