Skip to content

Commit 5189212

Browse files
committed
Fixing Issue swisnl#59 - Backdrop would not position properly in IE6
1 parent 18cc750 commit 5189212

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/jquery.contextMenu.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,12 +1116,22 @@ var // currently active contextMenu trigger
11161116
layer: function(opt, zIndex) {
11171117
// add transparent layer for click area
11181118
// filter and background for Internet Explorer, Issue #23
1119-
return opt.$layer = $('<div id="context-menu-layer" style="position:fixed; z-index:' + zIndex + '; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>')
1119+
var $layer = opt.$layer = $('<div id="context-menu-layer" style="position:fixed; z-index:' + zIndex + '; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>')
11201120
.css({height: $win.height(), width: $win.width(), display: 'block'})
11211121
.data('contextMenuRoot', opt)
11221122
.insertBefore(this)
11231123
.on('contextmenu', handle.abortevent)
11241124
.on('mousedown', handle.layerClick);
1125+
1126+
// IE6 doesn't know position:fixed;
1127+
if (!$.support.fixedPosition) {
1128+
$layer.css({
1129+
'position' : 'absolute',
1130+
'height' : $(document).height()
1131+
});
1132+
}
1133+
1134+
return $layer;
11251135
}
11261136
};
11271137

0 commit comments

Comments
 (0)