part of jQuery script doesn't run in Drupal 6.28 -


i wrote small jquery script runs in drupal site. site running jquery 1.7.1. works fine in jsfiddle, when run in drupal, part of script doesn't work. not sure if drupal thing or if have wrong code?

this self-tests on educational site. content arranged in slide toggles on page. inside of slide toggles these self tests. don't write database, they're user.

the objective here make self tests reset when slide toggle closed. here's jquery:

$("h2.titletrigger").click(function(e){ e.preventdefault();  //toggle open/close drawer $(this).toggleclass("active").next().slidetoggle("fast");  //undo self test $('.selftestwrong').removeclass('answershown'); $('input:radio').prop('checked', false); $('.selftestanswer').slideup(300);  return false; });   //self test  $('input:radio').bind('change',function(e){  e.preventdefault(); var parentid = $(this).parents('.selftest').attr('id'); $('#'+parentid+' .selftestwrong').addclass('answershown'); $('#'+parentid+' .selftestanswer').slidedown(300); }); 

you can see working correctly here: http://jsfiddle.net/brfxb/

the problem when run in drupal, works fine except part resets self test. when close , open slide toggle, nothing resets. no errors show in chrome's developer tools. edit: script loads @ bottom of page before tag. suggestions?

try use code after page load in drupal. think work charm


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -