iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-11-2006, 12:32 PM
WebProWorld Member
 
Join Date: Oct 2004
Location: UK
Posts: 79
nozzmoking RepRank 0
Default 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
Reply With Quote
  #2 (permalink)  
Old 08-11-2006, 02:02 PM
WebProWorld Member
 
Join Date: Feb 2004
Posts: 28
tomhouy RepRank 0
Default

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.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:47 PM.



Search Engine Optimization by vBSEO 3.3.0