Advertisement
salmancreation

The Selector-Query jQuery Plugin Responsive Desgin

Jun 11th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. 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:
  2.  
  3.  
  4. function wp_enqueue_script_selector_query() {
  5.     wp_enqueue_script(
  6.         'selector-query',
  7.         get_stylesheet_directory_uri() . '/js/jquery.selectorquery.min.js',
  8.         array( 'jquery' ),
  9.         false,
  10.         true
  11.     );
  12. }
  13. add_action( 'wp_enqueue_scripts', 'wp_enqueue_script_selector_query'
  14.  
  15.  
  16. jQuery(document).ready(function($) {
  17.     $('.selector').selectorQuery();
  18. });
  19.  
  20. $('.selector').selectorQuery({
  21.     'widthStops': [320, 480, 640, 960, 1024, 1280], // An array of widths
  22.     'classPrefix': 'max-' // Prefix class names with this
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement