Add new comment

Using Drupal behaviors and jQuery once, the code would be

(function($) {
Drupal.behaviors.customToggler = {
attach: function(context, settings){
$(".toggler", context).once('custom-toggler').click(function(){
$(this).next().slideToggle("slow");
return false;
}).next().hide();
};
};
})(jQuery);

This allows the script to work for elements added after the page loads.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.