You can make use of the setAllExceptFilter() method and setNoneExceptFilter() method to control where the pop-up menu can show up.

This div has an id = "showupregion". The pop-up menu will show up only if you left click inside this region. Clicking inside other regions will have no effect.

Now, click the link below to change the filter such that the menu will show up in all regions except the above region.

Change filter

Source code for creating menus in this page:

function createjsDOMenu() {
  cursorMenu1 = new jsDOMenu(120);
  with (cursorMenu1) {
    addMenuItem(new menuItem("Item 1", "", "blank.htm"));
    addMenuItem(new menuItem("-"));
    addMenuItem(new menuItem("Item 2", "", "blank.htm"));
    addMenuItem(new menuItem("Item 3", "", "blank.htm"));
    addMenuItem(new menuItem("Item 4", "", "blank.htm"));
    addMenuItem(new menuItem("-"));
    addMenuItem(new menuItem("Item 5", "", "blank.htm"));
    setNoneExceptFilter(new Array("DIV.showupregion"));
  }
  setPopUpMenu(cursorMenu1);
  activatePopUpMenuBy(0, 0);
}