1
fiammy
Are there special things to consider when adding Javascript to a theme?
  • 2004/7/22 8:56

  • fiammy

  • Just popping in

  • Posts: 19

  • Since: 2003/1/14


Hello,
I am trying to add some Javascript to a theme.html file, such as stuff to make my drop-down work, but also a clock a friend of mine specifically asked to be added to his theme.
When I simply include the javascript, it doesn't get executed as far as I can see. Are there specific procedures or checks to do before adding javascript?

A simple example : I need Javascript to get my CSS drop-down menu working in Internet Explorer. The menu works in Opera and Mozilla as it is supposed to, so there isn't an error there. However, in IE it doesn't work at all. No drop-down of any kind .

The text I included is this one :

startList = function() {
if (
document.all&&document.getElementById) {
navRoot document.getElementById("nav");
for (
i=0i<navRoot.childNodes.lengthi++) {
node navRoot.childNodes[i];
if (
node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  
node.onmouseout=function() {
  
this.className=this.className.replace(" over""");
   }
   }
  }
 }
}
window.onload=startList;


Any idea why this doesn't work? I included it in the HEAD part of the HTML file, and tried including it before and after the XOOPS javascript, to no avail.

Thank you very much,

fiammy

Login

Who's Online

245 user(s) are online (159 user(s) are browsing Support Forums)


Members: 0


Guests: 245


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits