Hi, I have a jquery toggle that works on my pure html where i derived my template from. But when I put it on my page.tpl it didnt work. First, my question is do i still need to put the jquery script? Coz i read somewhere that i do not need to put the jquery coz drupal have it by default. I tried putting it on mytheme/jscript/ still nothing happened.

I put the toggle script inside the body after the wrapper, before the $closure, here it is.

$(".toggleup").click(function(){ $("#chat").slideToggle("slow"); $(this).toggleClass("toggledown"); return false; });

Im sure many here have done this. Any help would be much appreciated. Thanks!

Comments

blackarma’s picture

Hey neriweaver.

By default drupal does not load jquery if there were no javascript included by modules or your .info file.
So for this to work just put your custom code in .js file and upload it to your theme (foldering is up to you) and then simply include it in your .info file. That should make drupal load it's jq 1.2.6 and your script.

Or you can also do something like this in your .tpl.php file

drupal_add_js('your inline jquery code', 'inline');

And put it where you wanted.