Search code examples
javascriptinternet-explorer-8icefaces

js function not working on IE8


I have a div and on mouseover I show an ice:menuPop with this function:

function fireContextMenu(element, event) {
   if (element.getAttribute('oncontextmenu')) {
      element.oncontextmenu = new Function ('event', element.getAttribute('oncontextmenu'));
      element.oncontextmenu(event);
   }
}

calling it like:

onmouseover="fireContextMenu(this, event);"

On Chrome is working perfect but on IE it does not appears. I suppose it's something wrong in the js or IE8 does not support hover of div?


Solution

  • Solved.

    No longer use the js function but use directly the value of oncontextmenu.

    For my case:

    onmouseover="Ice.Menu.contextMenuPopup(event, 'frmMainMenu:menuPopupCBM_sub', 'frmMainMenu:divMenuPopupCBM');return false;"