datamad2017/js/waves.min.js

9 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-07-28 21:27:01 +02:00
/*!
* 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);