Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-right-click got multi-context-menu (last one does not disappear) on IE9 #13

Open
hhmmdd opened this issue Apr 11, 2013 · 1 comment

Comments

@hhmmdd
Copy link

hhmmdd commented Apr 11, 2013

on IE9 the bg cover sometime not work, so I just add a few code, to avoid this,

// On contextmenu event (right click)
this.bind('contextmenu', function(e) {
//remove any old, maodonghu 2013/4/11
$('.bgCover').remove();
$('.'+settings.contextMenuClass).remove();

var menu = createMenu(e)
  .show();

...

var bg = $('<div class="bgCover"></div>')

@stewil87
Copy link

stewil87 commented Dec 3, 2014

The main issue isnt only on IE9
The cover sometimes doesn't work, because its height is set to 100%.
but if the page is higher you are able to load x new windows
(tested in Chrome Version 39.0.2171.71 m).

For Quick fix: set its height to clientHeight in jquery.contextmenu.js:

From:
// Cover rest of page with invisible div that when clicked will cancel the popup.
var bg = $('

')
.css({left:0, top:0, width:'100%', height:'100%', position:'absolute', zIndex:1000000})
.appendTo(document.body)
To:
// Cover rest of page with invisible div that when clicked will cancel the popup.
var bg = $('
')
.css({left:0, top:0, width:'100%', height:document.body.clientHeight+'px', position:'absolute', zIndex:1000000})
.appendTo(document.body)

[EDIT:]
Or ...ehm... of course set position from absolute to fixed

// Cover rest of page with invisible div that when clicked will cancel the popup.
var bg = $('

')
.css({left:0, top:0, width:'100%', height:'100%', position:'fixed', zIndex:1000000})
.appendTo(document.body)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants