EasyUI初体验–右键弹框

EasyUI初体验–右键弹框

大家好,又见面了,我是全栈君,祝每个程序员都可以多学几门语言。

    在C/S中可能非常easy实现右键弹框,但在B/S中直到今天我才搞定,小小得瑟一下。只一个html页面,导入相关的Easy-UI类库就能搞定,Easy-UI类库下载地址      

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="css/easyui.css" rel="stylesheet" type="text/css" />
    <link href="css/icon.css" rel="stylesheet" type="text/css" />
    <link href="css/demo.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/jquery.easyui.min.js" type="text/javascript"></script>
</head>
<body>
    <h2>点下右键试试</h2>
    <div style="margin:20px 0;"></div>
    
    <div id="mm" class="easyui-menu" style="width:120px;">
        <div onclick="javascript:alert('new')">新建</div>
        <div>
            <span>打开</span>
            <div style="width:150px;">
                <div><b>Word</b></div>
                <div>Excel</div>
                <div>PowerPoint</div>
                <div>
                    <span>M1</span>
                    <div style="width:120px;">
                        <div>sub1</div>
                        <div>sub2</div>
                        <div>
                            <span>Sub</span>
                            <div style="width:80px;">
                                <div onclick="javascript:alert('sub21')">sub21</div>
                                <div>sub22</div>
                                <div>sub23</div>
                            </div>
                        </div>
                        <div>sub3</div>
                    </div>
                </div>
                <div>
                    <span>Window Demos</span>
                    <div style="width:120px;">
                        <div data-options="href:'window.html'">Window</div>
                        <div data-options="href:'dialog.html'">Dialog</div>
                        <div><a href="http://www.jeasyui.com" target="_blank">EasyUI</a></div>
                    </div>
                </div>
            </div>
        </div>
        <div data-options="iconCls:'icon-save'">保存</div>
        <div data-options="iconCls:'icon-print',disabled:true">Print</div>
        <div class="menu-sep"></div>
        <div>退出</div>
    </div>
    <script>
        $(function () {
            $(document).bind('contextmenu', function (e) {
                e.preventDefault();
                $('#mm').menu('show', {
                    left: e.pageX,
                    top: e.pageY
                });
            });
        });
    </script>
</body>
</html>

效果图例如以下:

                                                          EasyUI初体验--右键弹框

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/118189.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • MQ入门总结(一)消息队列概念和使用场景

    MQ入门总结(一)消息队列概念和使用场景

    2021年11月3日
    46
  • pta集合相似度_结构相似度

    pta集合相似度_结构相似度原题链接输入样例:33 99 87 1014 87 101 5 877 99 101 18 5 135 18 9921 21 3输出样例:50.00%33.33%#include<bits/stdc++.h>#define x first#define y second#define send string::nopsusing namespace std;typedef long long ll;const int N = 1e4 + 10;cons

    2022年8月8日
    2
  • SIMD and Avx2

    SIMD and Avx2SIMD一条指令可以执行多个数据group的计算和输出。对于SIMD相对应的SISD.intel SSE2 ,AVX2,AVX-512假设有一个任务是统计字符串中每一个字符出现的次数,我们可以用128bit的SISD指令进行统计。每8个bit代表一个字符,所以只需要两个SIMD指令(movemask、popcount)。详细测试:#include<stdio.h>#include<thread>#defineINC_TO1000000//o

    2022年5月7日
    29
  • js页面刷新或关闭时弹框消失_js刷新页面如何保留页面内容

    js页面刷新或关闭时弹框消失_js刷新页面如何保留页面内容onbeforeunload事件属性  定义:在即将离开当前页面(刷新或关闭)时执行JavaScript,例如:<script>window.onbeforeunload=function(e){e.returnValue=(“确定离开当前页面吗?”);}</script>  用法:onbeforeunload事件在…

    2022年10月28日
    0
  • Redhat linux 命令行设置IP「建议收藏」

    Redhat linux 命令行设置IP「建议收藏」redhatlinux版本命令行设置IP ifconfigeth0NewIP然后编辑/etc/sysconfig/network-scripts/ifcfg-eth0,修改ip一、修改IP地址  [root@server/]$vi/etc/sysconfig/network-scripts/ifcfg-eth0  DEVICE=eth0  ONBOOT=yes  B…

    2022年5月7日
    39
  • input file样式设置

    input file样式设置需要提交input上传的文件等内容,所以需要form表单HTML代码 CSS样式#outData{ width:96%; background:#FFFFFF; height:100%; text-align:right; margin:0auto;}#upload{ display:inline-block; margin-top:5px

    2022年7月25日
    17

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号