ieHover.js question

    Date: 09/20/06 (Javascript Community)    Keywords: no keywords

    hi everyone.
    i'm trying to use this code, which works fine:

    startList = function() {
    if (document.all&&document.getElementById) {
    for (var j=0; j<2; j++) {
    var n = j ? 'mainnav' : 'nav';
    navRoot = document.getElementById(n);
    for (i=0; inode = 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;


    i want to be able to add more values to this line:
    var n = j ? 'mainnav' : 'nav';


    so it would be something like this:

    var n = j ? 'calendar' : 'departments' : 'mainnav' : 'nav';


    but that syntax is wrong and i don't know enough JS to know why (aside from needing to make j<4). can you help? and if you have the time to explain the correct syntax, that would be so great.
    thank you!

    Source: http://community.livejournal.com/javascript/113406.html

« What's wrong with this? || Computer Language... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home