Drupal 7 Theming: Initialize JQuery Script


/ Published in: JavaScript
Save to your folder(s)

Use this no-conflict wrapper instead of the default ready function in JQuery to initialize scripts in your Drupal 7 theme


Copy this code and paste it in your HTML
  1. (function ($) {
  2. Drupal.behaviors.YOURTHEMENAME = {
  3. attach: function(context, settings) {
  4.  
  5. /*Add your js code here*/
  6.  
  7. }
  8.  
  9. };
  10. })(jQuery);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.