Need Help with this Javascript

This is a discussion on "Need Help with this Javascript" within the JavaScript Forum section. This forum, and the thread "Need Help with this Javascript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 8th, 2005, 03:19
New Member
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Need Help with this Javascript

hello,


Can anyone tell me what i am doing wrong with this code. I'm trying to make a 'suckerfish dropdown menu' as mentioned in this article: http://www.alistapart.com/articles/dropdowns/ Thanks for the help..

Code: Select all
 
/*HTML*/
<script>
			startList = function() 
			{
				if (document.all&&document.getElementById)
				{
					navRoot = document.getElementById("nav");
					
					for (i=0; i<navRoot.childNodes.length; i++) 
					{
						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;
		</script>
		
	
	</head>

	<body  lang="en-US" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

		Skip to main content

		<div id="container">
		<div id="header">
			<div class="center">
				[img]images/logo-545.jpg[/img]
			</div>
			[img]images/bluelinebg.jpg[/img]
		</div>
		
		<div id="navigationPanel">
			<ul>
	
						[*]About eWorld Learning
	
						[*]Educational Consulting Services
						
						<li class="over">Cross-Cultural Services
							<ul id="nav">
								[*]For Corporations
								[*]For Online Universities
								[*]For International Development
								[*]For Instructional Designers
							[/list]						
						
						[*]Accessibility in E-Learning
						
						[*]E-Project Management
						
						<li class="over">Resources
							<ul id="nav">
								[*]Globalized E-Learning Cultural Challenges
								[*]Publications
								[*]Cross-Cultural Information
							[/list]						
						
						[*]Home
	
			[/list]		</div>

/*CSS*/
li ul {display: none;} 
li:hover ul, li.over ul{ display: block; }
Reply With Quote

  #2 (permalink)  
Old Aug 8th, 2005, 06:34
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I don't see anything obvious, it would help to know what it is or isn't doing though. Getting any errors? Got the page up somewhere?
Reply With Quote
  #3 (permalink)  
Old Aug 8th, 2005, 07:38
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
aha i see your problem...

you have id="nav" on the lists that you want to drop down... this needs to be removed from them, and added to the main <ul> that encircles the whole list...

you also need to remove class="over" from two of the[*]...

you should have this instead...

Code: Select all
<div id="navigationPanel">
         <ul id="nav">
   [*]About eWorld Learning
   [*]Educational Consulting Services
                  [*]Cross-Cultural Services
                     <ul>[*]For Corporations[*]For Online Universities[*]For International Development[*]For Instructional Designers[/list]                  
                  [*]Accessibility in E-Learning
                  [*]E-Project Management
                  [*]Resources
                     <ul>[*]Globalized E-Learning Cultural Challenges[*]Publications[*]Cross-Cultural Information[/list]                  
                  [*]Home
   [/list]      </div>
Reply With Quote
Reply

Tags
help, javascript

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript yvettesio JavaScript Forum 8 Mar 14th, 2007 23:18
JavaScript cbrams9 JavaScript Forum 1 Sep 20th, 2006 17:35
using xml in javascript shailu JavaScript Forum 0 Jul 25th, 2006 07:36
Can someone help me with this javascript Galaxyblue JavaScript Forum 2 Mar 11th, 2004 12:18
what does \\ mean in javascript jenjen1018 JavaScript Forum 5 Jan 6th, 2004 17:05


All times are GMT. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43