By mhaas01 on
I want to have an image that rotates from one graphic to another. I found code to do so at http://www.dyn-web.com/javascript/rotate-img/rotate-rand.html. But some of the code goes into the head section of a regular html page and some goes into the body. Here's some of the code from their sample page:
I would like to paste all this into the body of a story, but I think the head info needs to go somewhere else. I tried pasting the head portion into my theme file, but that didn't work — possibly because I didn't put it into the right part of my theme file.
Any suggestions?
Comments
I only ever needed to use
I only ever needed to use the
http://api.drupal.org/api/function/drupal_add_js/5
function, no need to touch the template or break anything.
I put my code in a "page" module or block though, by copy and pasting tutorial stuff off
http://api.drupal.org/api/file/developer/examples/page_example.module/5
so if you just want to hack into the template the "direct way" I can't help you.
Finally, the add_js function wants a good path (check that the generated page produces the js code else you typed a wrong path). The paths I use are like:
/site_root/sites/all/modules/my_new_module/js/blahblah.js