mirror of
https://github.com/medialab-prado/datamad2017.git
synced 2024-12-26 20:51:22 +01:00
9 lines
No EOL
1.1 KiB
JavaScript
9 lines
No EOL
1.1 KiB
JavaScript
/*!
|
|
* Waves v0.1.0
|
|
* https://publicis-indonesia.github.io/Waves/
|
|
*
|
|
* Copyright 2014 Publicis Metro Indonesia, PT. and other contributors
|
|
* Released under the BSD license
|
|
* https://github.com/publicis-indonesia/Waves/blob/master/LICENSE
|
|
*/
|
|
;(function(b,c){var a={};a.rippleShow=function(j){var i=c(this);i.append('<div class="waves-ripple"></div>');var k=i.offset();var h=(j.pageX-k.left);var f=(j.pageY-k.top);var g=i.outerWidth();i.data("hold",Date.now());i.data("relativeX",h);i.data("relativeY",f);var d=i.find(".waves-ripple");d.addClass("waves-notransition").css({top:f,left:h});d.context.offsetHeight;d.removeClass("waves-notransition").css({"border-width":g,"margin-top":-g,"margin-left":-g,opacity:1})};a.rippleHide=function(){var f=c(this);var d=f.find(".waves-ripple");var g=Date.now()-f.data("hold");var e=500-g;if(e<0){e=0}setTimeout(function(){d.css({top:f.data("relativeY"),left:f.data("relativeX"),opacity:0});setTimeout(function(){d.remove()},300)},e)};c(document).on("ready",function(){c(this).on("mousedown",".waves-element",a.rippleShow).on("mouseup mouseleave",".waves-element",a.rippleHide)})})(window,jQuery); |