Skip to content

Instantly share code, notes, and snippets.

@darren131
Created September 4, 2012 04:25
Show Gist options
  • Save darren131/3616574 to your computer and use it in GitHub Desktop.
Save darren131/3616574 to your computer and use it in GitHub Desktop.
// Your site namespace... may not need this?
var YOUR_SITE = YOUR_SITE || {};
Modernizr.load([
{
// load jquery from the CDN
load: '//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js',
complete: function () {
// id the CDN fails then load local version of jquery
if ( !window.jQuery ) {
Modernizr.load('/wp-content/themes/calliduscloud/js/libs/jquery-1.8.1.min.js');
}
}
},
{
// Responsive example: test to see if we're in 'desktop mode'
test: Modernizr.mq('screen and (min-width: 1040px)'),
// then load the navigation script
yep: '/js/navigation.js',
// then run the navigation init() method.
complete: function() {
YOUR_SITE.navigation.init();
}
},
{
// load all javascript assets
load: [
'/js/plugins/transition.js',
'/js/plugins/bootstrap-carousel.js',
'/js/plugins/bootstrap-tab.js',
'/js/frontend.js'
],
// execure your code here.
complete: function() {
$(document).ready(function() {
YOUR_SITE.frontend.init();
});
}
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment