Created
September 12, 2012 17:43
-
-
Save carwin/3708494 to your computer and use it in GitHub Desktop.
Drupal 7: Proper implementation of jQuery in a Drupal 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
(function ($) { | |
Drupal.behaviors.themename = { | |
attach: function(context, settings) { | |
// Add a hover class to nav items. | |
$('.mainnav nav a') | |
.hover( | |
function() { | |
$(this).addClass('hover'); | |
}, | |
function() { | |
$(this).removeClass('hover'); | |
} | |
);// end hover | |
}} | |
}) (jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment