Skip to content

Instantly share code, notes, and snippets.

@midnai
Created August 2, 2018 20:04
Show Gist options
  • Save midnai/5af0a0d73770332a0f844012b46533de to your computer and use it in GitHub Desktop.
Save midnai/5af0a0d73770332a0f844012b46533de to your computer and use it in GitHub Desktop.
Jquery-document-ready
$(document).ready(function() {
//do jQuery stuff when DOM is ready
});
jQuery(document).ready(function($) {
//do jQuery stuff when DOM is ready
});
$(function(){
//jQuery code here
});
(function($) {
// code using $ as alias to jQuery
$(function() {
// more code using $ as alias to jQuery
});
})(jQuery);
$(window).load(function(){
//initialize after images are loaded
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment