Last active
August 29, 2015 13:58
A concept for overriding parent theme JavaScript in a child theme.
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
window.themeName = window.themeName || {}; | |
(function( window, $, undefined ) { | |
'use strict'; | |
// Override the carousel config properties. | |
themeName.config.carousel.autoPlay = true; | |
themeName.setupCarousel = function() { | |
// Override the carousel set up without affecting anything else. | |
}; | |
})( this, jQuery ); |
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
window.themeName = window.themeName || {}; | |
(function( window, $, undefined ) { | |
'use strict'; | |
$.extend( window.themeName, { | |
config: { | |
// Default carousel properties. | |
carousel: { | |
autoPlay: false | |
} | |
}, | |
init: function() { | |
// Initialize the theme JS. | |
}, | |
setupCarousel: function() { | |
// Default carousel functionality. | |
// $( '.carousel' ).carousel( this.config.carousel ); | |
}, | |
setupGalleries: function() { | |
// Default gallery functionality. | |
} | |
}); | |
$( document ).ready(function() { | |
themeName.init(); | |
themeName.setupCarousel(); | |
themeName.setupGalleries(); | |
}); | |
})( this, jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment