WheelEvent.deltaMode.html (2514B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title id='desc'> WheelEvent: wheel - WheelEvent.deltaMode </title> 5 <script type="text/javascript"> 6 var PassTest = function() 7 { 8 document.getElementById("testresult").firstChild.data = "PASS"; 9 } 10 11 var FailTest = function() 12 { 13 document.getElementById("testresult").firstChild.data = "FAIL"; 14 } 15 16 var EVENT = "wheel"; 17 var TARGET; 18 19 window.onload = function() 20 { 21 try 22 { 23 TARGET = document.getElementById("target"); 24 TARGET.addEventListener(EVENT, TestEvent, true); 25 } 26 catch(ex) 27 { 28 FailTest(); 29 } 30 } 31 32 function TestEvent(evt) 33 { 34 if ((0x00 == evt.deltaMode) || (0x01 == evt.deltaMode) || (0x02 == evt.deltaMode)) 35 { 36 PassTest(); 37 } 38 else 39 { 40 FailTest(); 41 } 42 } 43 </script> 44 </head> 45 <body> 46 <h3>DOM Events</h3> 47 <h4> 48 Test Description: WheelEvent.deltaMode attribute contains an indication of the units of 49 measurement for the delta values. Its value may be different based on system configuration. 50 </h4> 51 52 <span id="parent"> 53 <div id="target" style="border:solid 1px green; width:220px; height:70px; overflow:scroll"> 54 TOP TOP TOP TOP TOP TOP TOP 55 Scroll mouse wheel over here 56 Scroll mouse wheel over here 57 Scroll mouse wheel over here 58 Scroll mouse wheel over here 59 Scroll mouse wheel over here 60 Scroll mouse wheel over here 61 END END END END END END END 62 </div> 63 </span> 64 <p id="manualsteps"> 65 Steps: 66 <ol> 67 <li> Note: an input device with scroll wheel support (e.g., mouse wheel) is required 68 <li> Move the mouse pointer over the above green box 69 <li> Scroll down the mouse wheel 1 or more units 70 </ol> 71 </p> 72 <p>Test passes if the word "PASS" appears below after following the above steps.</p> 73 <div>Test result: </div> 74 <div id='testresult'>FAIL</div> 75 </body> 76 </html>