Skip to content

Instantly share code, notes, and snippets.

@input
Created January 22, 2012 20:51
Show Gist options
  • Save input/1658737 to your computer and use it in GitHub Desktop.
Save input/1658737 to your computer and use it in GitHub Desktop.
Drupal 6 jQuery Demo
<a href="#" id="togg-link">Click this link to toggle the content displayed below</a>
<div id="togg">Content to be toggled.</div>
Drupal.behaviors.togg = function (context) {
$('a#togg-link:not(.togg-processed)', context).addClass('togg-processed').each(function () {
$(this).click(function() {
$("div#togg").toggle(400);
return false;
});
});
};
Usage
-----
- Output the HTML somewhere (e.g. in a node body)
- Add the js to your theme's scripts.js file
See: http://lhmdesign.com/drupal-jquery-demo for a demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment