• JS高级设计第七章——复习知识点


    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>txt</title>
    </head>
    <body>
    <input type="button" onclick="alert(&quot;1&quot;)" />
    <input type="button" onclick="alert('1')" />
    <script>
    //事件
    function(ev){
        switch(ev.type){
            case 'mouseover':
                dosometing;
                break;
            case 'mouseout':
                dosometing:
                break;
            default:
                dowhat
                break;
        }
    };
    //
    /*
        event.target and event.currentTarget
        currentTarget === this;
        是不同的,targe( srcElement )也可以是是冒泡的元素;
        event.relateTarget;
        页面在不存在滚动的情况下 pageX和clientX相等的..
        
        click dblclick onmousemove 在屏幕阅读器里无法触发;
        而且dblclick用键盘是无法实现的;
        
        keydown是用户按任意键时候触发
        keypress是用户按字符时候触发
        event.shiftKey || event.ctrlKey || event.altKey || event.metaKey
        
        textInput这个事件是DOM3的事件,只有在输入框输入字符时候才触发的事件
        
        DOM节点被操作变动的事件
        1: DOMSubstreeModified dom结构发生变化即触发
        2: ..
        
        hashchange事件 #adf #asdf url变化
        
        移动设备的事件 :
        1 : orientationchange
        2 : diviceorientation 设备方向发生改变的时候
        3 : devicemotion 设备移动或者其他情况触发 ,有点 nation app的api的感觉有木有;
        
        移动设备事件触发顺序
        1 : touchstart =>
        
            mouseover =>
            mousemove =>
            mouseup =>
            click 
            
            touchend =>
            
            
        2 : gesturestar =>
            gesturechange =>
            getstureend 
        
    */
        '事件的模拟触发 ~_~ ,只是基于标准的事件, ie的没记录';
        var ev = document.createEvent('MouseEvent');
        ev.init('click'/*一堆参数*/);
        ipt.dispatchEvent( ev );
        
        ev = document.createEvent('KeyEvent');
        ev.init('keypress'/*___*/);
        ipt.dispatchEvent( ev )
    </script>
    </body>
    </html>
  • 相关阅读:
    [INS-32033] Central Inventory location is not writable
    ORACLE中的PL/SQL
    Oracle几大后台进程
    2016年中山市信息学竞赛暨全国信息学联赛成绩表(普及组)
    NOIP复习资料——往年习题精选
    迪杰斯特拉dijkstar(算法个人观点)
    【USACO题库】1.4.2 The Clocks时钟.TJ
    【USACO题库】2.1.2 Ordered Fractions顺序的分数.tj
    纪中2016.10.6比赛不明总结
    纪中2016.8.17比赛不明总结
  • 原文地址:https://www.cnblogs.com/diligenceday/p/3484717.html
Copyright © 2020-2023  润新知