From 25e934452d5c02d86d7ae58c0f71dc08451085ed Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sat, 5 Aug 2017 23:41:26 +0100 Subject: [PATCH] gulp stuff --- public/javascripts/shorten.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/public/javascripts/shorten.js b/public/javascripts/shorten.js index c24f949..25952a2 100644 --- a/public/javascripts/shorten.js +++ b/public/javascripts/shorten.js @@ -13,3 +13,26 @@ $('#btn-shorten').on('click', function(){ }); }); + +(function($) { + $.extend($.fn, { + fadeIn: function(ms) { + if(typeof(ms) === 'undefined') ms = 500; + + $(this).css({ display: 'block', opacity: 0 }).animate({ opacity: 1 }, ms); + + return this; + }, + + fadeOut: function(ms) + { + if(typeof(ms) === 'undefined') ms = 500; + + $(this).css({ opacity: 1 }).animate({ opacity: 0 }, ms, 'linear', function() { + $(this).css('display', 'none'); + }); + + return this; + } + }); +})(Zepto);