zoukankan      html  css  js  c++  java
  • javascriptAPI 地图窗口任意位置右键显示菜单功能

    地图窗口任意位置右键显示菜单功能,把如下javascript代码写入单独的脚本,直接引入map窗口所在的html页面即可:

    Creation from markup is even easier. This example creates a context menu for the whole window.

    dojo.require("dijit.Menu");
    dojo.require("dijit.ColorPalette");
    <div data-dojo-type="dijit.Menu" id="windowContextMenu" data-dojo-props="contextMenuForWindow:true" style="display: none;">
        <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCut',
            onClick:function(){alert('not actually cutting anything, just a test!')}">Cut</div>
        <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCopy',
            onClick:function(){alert('not actually copying anything, just a test!')}">Copy</div>
        <div data-dojo-type="dijit.MenuItem" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconPaste',
            onClick:function(){alert('not actually pasting anything, just a test!')}">Paste</div>
        <div data-dojo-type="dijit.MenuSeparator"></div>
        <div data-dojo-type="dijit.PopupMenuItem">
            <span>Enabled Submenu</span>
            <div data-dojo-type="dijit.Menu" id="submenu1">
                <div data-dojo-type="dijit.MenuItem" data-dojo-props="onClick:function(){alert('Submenu 1!')}">Submenu Item One</div>
                <div data-dojo-type="dijit.MenuItem" data-dojo-props="onClick:function(){alert('Submenu 2!')}">Submenu Item Two</div>
            </div>
        </div>
        <div data-dojo-type="dijit.PopupMenuItem">
            <span>Popup of something other than a menu</span>
            <div data-dojo-type="dijit.ColorPalette"></div>
        </div>
    </div>
    
    <span>Right click anywhere on this page to see a menu</span>

    Note that popup menus should be hidden via specifying style=”display: none”.Hiding the menu indirectly via a class won’t work (in that the menu will remain invisible even when it’s supposed to be displayed).

    原文链接:http://dojotoolkit.org/reference-guide/1.7/dijit/Menu.html

  • 相关阅读:
    在SharePoint 2010中创建网站的权限级别
    SharePoint 2013 Pop-Up Dialogs
    SharePoint 2010 Pop-Up Dialogs
    sharepoint 2010 页面添加footer方法 custom footer for sharepoint 2010 master page
    Using SharePoint 2010 dialogs
    Spring Security
    mysql优化
    memcached缓存技术
    网页静态化技术
    最小生成树
  • 原文地址:https://www.cnblogs.com/dwf07223/p/3028008.html
Copyright © 2011-2022 走看看