Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Once you have it in your theme directory, you can add this code in your functions.php to enqueue Selector-Query right before the body is closed. This would save us some page load time:
- function wp_enqueue_script_selector_query() {
- wp_enqueue_script(
- 'selector-query',
- get_stylesheet_directory_uri() . '/js/jquery.selectorquery.min.js',
- array( 'jquery' ),
- false,
- true
- );
- }
- add_action( 'wp_enqueue_scripts', 'wp_enqueue_script_selector_query'
- jQuery(document).ready(function($) {
- $('.selector').selectorQuery();
- });
- $('.selector').selectorQuery({
- 'widthStops': [320, 480, 640, 960, 1024, 1280], // An array of widths
- 'classPrefix': 'max-' // Prefix class names with this
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement