Submit Your Article Forum Rules

Results 1 to 2 of 2

Thread: CSS problem - help needed

  1. #1

    CSS problem - help needed

    Hope someone can help me fix this. Every page on a new site I'm working on loads but with the following script error:

    Line: 37
    Char. 7
    Error. 'menuitem1.thediv' is null or not an object
    Code 0

    This is the code with the offending line highlighted.


    <!--
    var time = 3000;
    var numofitems = 7;

    //menu constructor
    function menu(allitems,thisitem,startstate){
    callname= "gl"+thisitem;
    divname="subglobal"+thisitem;
    this.numberofmenuitems = 7;
    this.caller = document.getElementById(callname);
    this.thediv = document.getElementById(divname);
    this.thediv.style.visibility = startstate;
    }

    //menu methods
    function ehandler(event,theobj){
    for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
    }
    theobj.thediv.style.visibility="visible";
    }

    function closesubnav(event){
    if ((event.clientY <48)||(event.clientY > 107)){
    for (var i=1; i<= numofitems; i++){
    var shutdiv =eval('menuitem'+i+'.thediv');
    shutdiv.style.visibility='hidden';
    }
    }
    }
    // -->


    Makes no sense to me whatsoever. Ideas anyone?

    TIA

  2. #2
    Junior Member
    Join Date
    Feb 2004
    Posts
    28
    I'm not a scripting guru, but I think it might possibly have something to do with using quotation marks instead of apostrophes. Try using apostrophes to surround the words menuitem and .thediv and see if that works.

Similar Threads

  1. Problem with Sothink software:urgent sugges'n needed
    By Informer45 in forum Web Programming Discussion Forum
    Replies: 0
    Last Post: 12-31-2005, 04:00 AM
  2. Have you ever needed a babysitter? Promote a service needed
    By robertk53 in forum Affiliate Marketing Discussion Forum
    Replies: 2
    Last Post: 12-20-2005, 09:21 AM
  3. Help needed with Firefox display problem
    By Gary Allman in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 03-11-2005, 12:11 PM
  4. Help needed with CSS Problem across browsers (Amended)
    By RicInACloak in forum Graphics & Design Discussion Forum
    Replies: 4
    Last Post: 02-17-2004, 01:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •