Skip to content

Commit

Permalink
fixed bug of attaching multiple ripple styles to head.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz committed Dec 8, 2017
1 parent dd9ef82 commit b10b2bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scrollimate.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ var scrollimate = (function( window, $ ){
var noclass = false;
}

$('<style>.ripplestyles{display: inline-block;overflow:hidden;position: relative;}.ripple-effect{pointer-events: none;animation: ripple-animation 2s;-webkit-animation: ripple-animation 2s;-ms-animation: ripple-animation 2s;-o-animation: ripple-animation 2s;-moz-animation: ripple-animation 2s;background: white;border-radius: 50%;height: 50px;position: absolute;width: 50px;}@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-webkit-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-ms-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-o-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-moz-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}</style><!--[if IE 9]><style>.ripple-effect{display:none;}</style><![endif]-->').appendTo($('head'));

if($("#scrollimate__ripplestyles").length){}else{
$('<style id="scrollimate__ripplestyles">.ripplestyles{display: inline-block;overflow:hidden;position: relative;}.ripple-effect{pointer-events: none;animation: ripple-animation 2s;-webkit-animation: ripple-animation 2s;-ms-animation: ripple-animation 2s;-o-animation: ripple-animation 2s;-moz-animation: ripple-animation 2s;background: white;border-radius: 50%;height: 50px;position: absolute;width: 50px;}@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-webkit-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-ms-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-o-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}-moz-@keyframes ripple-animation {from {transform: scale(1);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);-moz-transform: scale(1);opacity: 0.4;}to {transform: scale(100);-webkit-transform: scale(100);-ms-transform: scale(100);-o-transform: scale(100);-moz-transform: scale(100);opacity: 0;}}</style><!--[if IE 9]><style>.ripple-effect{display:none;}</style><![endif]-->').appendTo($('head'));
}

if(!noclass){
$target.addClass('ripplestyles');
}
Expand Down

0 comments on commit b10b2bc

Please sign in to comment.