Log in

View Full Version : Menu Javascript Question


Princeton
02-15-2006, 12:56 PM
Currently, the navbar dropdown menu is created in such a manner*:
<td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
Now, I'm wondering why it isn't done this way:
<td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow" onclick="vbmenu_register('navbar_search')">$vbphrase[search]</a></td>

I'm guessing that it's done this way* for a reason (eg. browser compatibility). I'm not sure why it's done this way--but, there has to be a reason. Anyone have a clue?

I'm asking because if I don't -- I will keep wondering.:D

rossco_2005
03-06-2006, 12:23 AM
I don't know but also was wondering this so i'm bumping to find out.

Brad
03-06-2006, 01:08 AM
Because that would be inline javascript. Take a look at the file /root/vbulletin/clientscript/vbulletin_menu.js, the code that picks up on the mouse click is there.

This allows you to change the javascript to suit your needs without having to fool with the xhtml.