English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories




Dynamic Menu



















2006-10-29 02:11:10 · 1 answers · asked by Robyn in the Hoode 2 in Computers & Internet Programming & Design

1 answers

I don't know if you wrote this yourself or picked it up somewhere, but I'm afraid it's a bit of a mess and will never work. Some of the problems:

1. if (document.layers)... - the end of this line has been cut short by Yahoo, but in any case you would need a new line after the bracket - and ideally curly braces wrapping the rest of the code.

2. In the track() function, what are event, epageX and epageY? You don't declare them anywhere.

3. You can't set the visibility of an element via those eval calls. You need to learn about the DOM - any javascript tutorial should cover this. You would need something like:
document.getElementById(divref + "b." + stlref).visibility = 'hidden';

4. typo in your styles - "absoulute"

5. a href="javascript://" - this doesn't mean anything. If you don't want the link to go anywhere, use href="#" and make sure your javascript returns false.

6. Calling a function (track) every time you move the mouse is incredibly inefficient. Not sure what this is supposed to achieve.

Instead of trying to fix this code, I would recommend using an off-the-shelf javascript toolkit. Yahoo's own UI toolkit has quite a good menu widget.

2006-10-29 20:38:26 · answer #1 · answered by Daniel R 6 · 1 0

fedest.com, questions and answers