I'm using jQuery accordion effects to display some information. I include the libraries:
drupal_add_js('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', file);
drupal_add_js('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js', file);
Those seem to work fine, since after including them I can paste
jQuery(".accordion").accordion({collapsible:true,active:false});
into scratchpad and I get the functionality I want.
However, if I try to add it to my function like so:
drupal_add_js('jQuery(".accordion").accordion({collapsible:true,active:false});', inline);
...nothing happens. I've tried some variations, such as
drupal_add_js('jQuery(document).ready((".accordion").accordion({collapsible:true,active:false}));');
as well as moving the drupal_add_js() call further downstream in my code, so it appears after the elements it acts on are created and rendered.
How do I get this little snippet of code to run on my page?