Created
November 18, 2014 14:40
-
-
Save szeidler/e5efb30d5b65f08b093e to your computer and use it in GitHub Desktop.
Use custom jQuery toggle functionality in Drupal 7 to prevent multiple triggered elements, because of updated DOM
This file contains hidden or 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.accordion = { | |
attach: function (context, settings) { | |
$('.accordion h3.title').once('accordion', function () { | |
$('.accordion h3.title').toggle(function () { | |
// Actions here | |
}, function () { | |
// Actions here | |
}); | |
}); | |
} | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment