|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| 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
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
|||
|
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.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |