Skip to content

Instantly share code, notes, and snippets.

@rwbaker
Created October 17, 2011 01:35
Show Gist options
  • Save rwbaker/1291724 to your computer and use it in GitHub Desktop.
Save rwbaker/1291724 to your computer and use it in GitHub Desktop.
JavaScript: jQuery Plugin Bootstrap
$(document).ready(function() {
app.loadPlugins()
//Initialize for all pages
app.init.main()
})
var app = {
init: {
main: function () {
//Cache the DOM
jQuery.root = jQuery(document)
//This is how you use it:
//jQuery.root.find('div.special-selector').doSomething()
//Prevent blank links from having any effect
$('a[href="#"]').click(function () { return false; })
}
},
loadPlugins: function () {
/* Plugins */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment