Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:42
HREF Function called twice when I click on a menu item image
Poster: annset
Dated: Tuesday September 24 2002 - 19:36:50 BST
Hello. I'm having a problem using <img> item items that reference javascript functions in my menus. Specifically, it appears that, when I click on these images, the javascript function is invoked *twice*. This only happens in internet explorer 5.5, sp2.
For example, suppose I set up my menu like this:
Code:
addmenu(menu=[
"_vpToolbarMenuBar",
112,
186,
,
0,
,
_vpDefaultMenuBarStyle,
1,
"left",
,,
1,
,
,
,
,
,
,
,
,
,
,"Actions","show-menu=menu1","#",,1
,"Properties","show-menu=menu2","#",,1
," <img src=\"images/icon_viewgraph_off.gif\" border=\"0\" title=\"View Graph\"> ","javascript:if(doNothing())document.location=\"ft_index.html\" ",,,0
])
"_vpToolbarMenuBar",
112,
186,
,
0,
,
_vpDefaultMenuBarStyle,
1,
"left",
,,
1,
,
,
,
,
,
,
,
,
,
,"Actions","show-menu=menu1","#",,1
,"Properties","show-menu=menu2","#",,1
," <img src=\"images/icon_viewgraph_off.gif\" border=\"0\" title=\"View Graph\"> ","javascript:if(doNothing())document.location=\"ft_index.html\" ",,,0
])
Note that the last menu element (an image that appears directly on the menu bar) has a javascript statement as an href, which calls the "doNothing" function. When I click the image, that function is called twice.
This doesn't happen with non-image menu items.
Does anyone have any idea what may be causing this?
Thanks.
Ramsey