admin管理员组

文章数量:1130349

可以在整个页面中屏蔽,也可以在某个元素上屏蔽右键菜单
js代码:

function hideRightClickMenu() {
    window.event.returnValue = false;
    return false;
}

一、在动态创建的div中绑定事件:

parent.$("<div id='topWin' style='overflow:hidden;' οncοntextmenu='hideRightClickMenu()'></div>").dialog({
        title: title,
        iconCls: iconCls,
        border: 'thin',
        href: url,
        modal: true,
        width: _width,
        height: _height,
        top: ($(parent.window).height() - _height) * 0.5,
        left: ($(parent.window).width() - _width) * 0.5,
        //openAnimation: 'slide',
        //closeAnimation: 'show',
        //closeDuration:1000,
        minimizable: false,
        maximizable: _maximizable,
        collapsible: false,
        resizable: false,
        cache: false,
    })

二、在body上绑定事件:

<body style="overflow-y: hidden" class="easyui-layout" onmousemenu="hideRightClickMenu()" >

秋风写于淄博 业务联系与技术交流:qq375172665

可以在整个页面中屏蔽,也可以在某个元素上屏蔽右键菜单
js代码:

function hideRightClickMenu() {
    window.event.returnValue = false;
    return false;
}

一、在动态创建的div中绑定事件:

parent.$("<div id='topWin' style='overflow:hidden;' οncοntextmenu='hideRightClickMenu()'></div>").dialog({
        title: title,
        iconCls: iconCls,
        border: 'thin',
        href: url,
        modal: true,
        width: _width,
        height: _height,
        top: ($(parent.window).height() - _height) * 0.5,
        left: ($(parent.window).width() - _width) * 0.5,
        //openAnimation: 'slide',
        //closeAnimation: 'show',
        //closeDuration:1000,
        minimizable: false,
        maximizable: _maximizable,
        collapsible: false,
        resizable: false,
        cache: false,
    })

二、在body上绑定事件:

<body style="overflow-y: hidden" class="easyui-layout" onmousemenu="hideRightClickMenu()" >

秋风写于淄博 业务联系与技术交流:qq375172665

本文标签: 屏蔽右键菜单器中如何在JS