Home › Forums › JavaScript › New to JS
- This topic is empty.
-
AuthorPosts
-
December 24, 2009 at 12:03 pm #27326kb2tfaMember
Hi Im having trouble with this example of JS menu. can someone look over my code I can’t see what’s wrong.
HTML file
Code:CSS FILE "style.css"
Code:/* The whole menu */
#menu {
position: absolute;
}/* each menu name */
#menu li {
float: left;
list-style-type: none;
padding-right: 20px;
width: 100px;
background-color: silver;
}/* The entire submenu */
#menu li ul {
background-color: silver;
margin: 0px;
padding: 0px;
}/* each submenu item */
#menu li ul li {
padding: 0px;
margin: 0px;
float: none;
list-style-type: none;
width: 80px;
}JAVASCRIPT FILE "dropdown.js"
Code:// global variables for timeout and for current menu
var t=false, current;
function SetupMenu(){
if (!document.getElementsByTagName) return;
items=document.getElementsByName(“li”);
for (i=0; iDecember 24, 2009 at 12:06 pm #68633kb2tfaMemberforgot to mention you’ll see comments like "lowercase" etc. that’s where I was trying some changes to fix, but nope
December 24, 2009 at 7:56 pm #68643RobinMemberIs is posible for you to start using jQuery? It’s way more easy and efficient way to create these kind of effects on your website.
December 24, 2009 at 9:46 pm #68652kb2tfaMemberthe thought did cross my mind, but the documentation is so obtrude. I’ll look into it. thx
AuthorPostsViewing 4 posts - 1 through 4 (of 4 total)- The forum ‘JavaScript’ is closed to new topics and replies.