- 4
- 0
- 约 9页
- 2017-03-09 发布于上海
- 举报
The Web Wizard’s Guide To JavaScript wpsWeb向导指南JavaScript WPS.prenhall
The Web Wizard’s Guide To DHTML and CSS Chapter 6 Understanding Events Chapter Objectives Learn the history of Web browser event models Discover the nature of events on the Web Explore event propagation and bubbling Discover mouse events and position Use visibility techniques to create hypertext Create drag-and-drop applications Use keyboard events in Web page development History of Web Browser Events Limited support for events in early browsers Expanded events in version 4.0 browsers Disparate event models (NN4 vs. IE4) New W3C event model Events on the Web Browser creates events in response to user action. Event object begins life when user acts Event object ends life when scripts stop processing it One event at a time Netscape and W3C static Event object IE4+ window.event Every event has a target Propagation and Bubbling Tracking Mousemove Events and Mouse Position body onmousemove = showxy(event);” function showxy(evt){ if (window.event){ evt = window.event; } if (evt){ var pos = evt.clientX + , + evt.clientY; window.status=pos; } } Hypertext with Mouse Events Title tag for single line tool tips Hypertext for multi-line content Add event handlers to links onmouseover=doHT(event,vitry,visible);” onmouseout=doHT(event,vitry,’hidden);” First parameter passes event Second parameter passes ID Third parameter passes visibility Drag-and-Drop Applications Place drag-and-drop code in library Place utility functions in library Add event handlers to div onmousedown=setDrag(event,this); onmouseup=checkdroploc(1,0);” Drag begins on mousedown Drag ends on mouseup Script checks new position of div Keyboard Events Keyboard is fasted input device onload=init();” document.onkeyup = getKeyEvent; Obtains keyCode Check for letters, numbers, or space bar Swap text node value to show key typed * * *
您可能关注的文档
- The Semantic Web语义网.ppt
- The Sermon on the Mount Matt 51729山上马特51729布道.ppt
- The Security Plan Effectively Teaching How to Write One安全计划有效地教如何写.ppt
- The Senses and Living Things Two Rivers Wildlife感官和生物两只河流的野生动物.ppt
- The Selfish Giant自私的巨人. I.C. SAN GIORGIO DI MANTOVA.ppt
- The Service Delivery System Western Illinois University服务传递系统伊利诺斯西部大学.ppt
- The Selfish Giant Improving key Competences 自私的巨人提高关键能力.ppt
- The Seven Keys to Success Finding The Right 成功的七个关键找到正确的.ppt
- The Service Delivery System Boston College服务传递系统波士顿学院.ppt
- The setting of Stone Fox MBHS IMC Home Page石头狐狸MBHs IMC主页设置.ppt
最近下载
- 某天然气公司燃气系统运行安全现状评价报告.doc
- 维修Switch+中文版教程.pdf VIP
- 公共营养师四级试题【含答案】.docx VIP
- 统编人教部编版小学六年级下册道德与法治第一单元教学案.docx VIP
- IPC-6012F-CN-中文版 2024 TOC 刚性印制板的鉴定及性能规范.pdf VIP
- 2025年寒假作业七年级生物北师大版答案.pdf VIP
- impella for doctors左心辅助知识讲座.pptx VIP
- 成人患者医用粘胶相关性皮肤损伤的预防及护理(1).pptx VIP
- 安徽省高新技术产品国际竞争力:现状、挑战与提升策略.docx VIP
- PENTAX宾得 645NII相机手册.pdf VIP
原创力文档

文档评论(0)