Last active
December 4, 2016 15:56
-
-
Save elieandraos/5849270 to your computer and use it in GitHub Desktop.
Creating a prototype function on a dom element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.customFadeIn = function(fn) { | |
//set opacity to 0 and visibility to visibile | |
$(this).css({"opacity" : 0, "visibility" : "visible" }); | |
$(this).animate({opacity: 1}, 1000, "swing", function(){ | |
if(typeof fn == 'function') | |
fn.call(this); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment