Dhtmlxmenu right click to open in new tab

Hi there,

I’m using the menu script with xml created by php and mysql.
My current script to load the menu is the following:

<script> var menu; function initMenu() { menu = new dhtmlXMenuObject("menuObj"); menu.setIconsPath("imgs/"); menu.attachEvent("onClick",function(id){var url = menu.getUserData(id,"url");url = url.replace("%26", "&");location.href(url)}); menu.enableDynamicLoading("http://intranet.nexusfoams.com/intranet/menu2/menu.php"); } </script>

What my users would like is to be able to open a link in a new tab in IE 8. Right clicking on a menu option is ignored, could this be enabled at all?

Hi,

oncontextmenu event browser event is disabled in dhtmlxmenu.js. You may try to locate and comment the following lines to enable it:

this.base.oncontextmenu = function(e) { e = e || event; e.returnValue = false; return false; }

m.oncontextmenu = function(e) { e = e || event; e.returnValue = false; return false; }

s.oncontextmenu = function(e) { e = e||event; e.returnValue = false; e.cancelBubble = true; return false; }

I tried to comment those lines as suggested but right-click behaviour is still the same…any other hint?

In details:

not commenting: no right-click event at all…

commenting: browser standard popup BUT the shortcut to open the link in a new tab is not showing…it seems the browser is not able to recognize the link

Hi,

my users are asking for this functionality too.

Any way to active this option on IE / Chrome?

Hi

you can try set Text as text for menu item