• dojo/touch鼠标事件


    dojo/mouse提供了鼠标事件中需要的方法。

    简介:用来给指定节点(node)绑定鼠标事件

    方法:

    cancle(node, listener):给节点(node)绑定鼠标'touchcancel'|'mouseleave'

    enter(node, listener):给节点(node)绑定鼠标enter or touch

    leave(node, listener):给节点(node)绑定鼠标leave or touch

    move(node, listener):给节点(node)绑定鼠标或者手指dragged

    out(node, listener):给节点(node)绑定鼠标'mouseout' or touch

    over(node, listener):给节点(node)绑定鼠标'mouseover' or touch

    press(node, listener):给节点(node)绑定鼠标或'touchstart'|'mousedown'

    release(node, listener):给节点(node)绑定鼠标按下之后释放

    实例代码如下

     1 <!DOCTYPE html>
     2 <html >
     3 <head>
     4     <style type="text/css">
     5         @import url("http://localhost/arcgis_js_api/library/3.12/3.12/dijit/themes/claro/claro.css");
     6     </style>
     7     <script type="text/javascript">
     8         var dojoConfig = {
     9             isDebug: true, // 调试
    10             async: true,
    11             parseOnLoad: false
    12         };
    13     </script>
    14     <script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.12/3.12/init.js"></script>
    15     <script>
    16         require([
    17             "dojo/ready",
    18             "dojo/mouse",
    19             "dojo/touch",
    20             "dojo/on",
    21             "dojo/dom",
    22             "dojox/image/LightboxNano",
    23             "dijit/layout/ContentPane",
    24             "dijit/form/Button",
    25             "dojo/domReady!"
    26         ], function (ready,mouse,touch,on,dom,LightboxNano,ContentPane,Button) {
    27             var btn = new Button({
    28                 label:"Button"
    29             },"btn");
    30             touch.over(btn,function(){
    31                 alert("touch.over");
    32             });
    33         });
    34     </script>
    35 </head>
    36 <body class="claro">
    37 <div id="btn"></div>
    38 </div>
    39 </body>
    40 </html>
    View Code
  • 相关阅读:
    kubenetes-学习
    k8s-字段
    Spring Boot集成mongodb
    synchronized关键字
    Scala手记
    Python数据结构&封装解构
    Scala基础之集合
    Scala基础之集合常用方法
    Scala(2.12)之collection基本操作
    Scala基础之集合(数组)
  • 原文地址:https://www.cnblogs.com/yuankunblogs/p/4350373.html
Copyright © 2020-2023  润新知