Created
September 5, 2018 09:45
-
-
Save santhosh17s/6fa3fa324884c58934f69eba7ec53c43 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$('document').ready( function(){ | |
//WITHOUT ARROW FUNCTION | |
$('.my-name').on('click', function() { | |
var that = this; | |
setTimeout( function() { | |
$(that).toggleClass('on'); | |
}, 1000); | |
}); | |
//WITH ARROW FUNCTION | |
$('.my-name').on('click', function() { | |
setTimeout( () => { | |
$(this).toggleClass('on'); | |
}, 1000); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment