mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Base: Add a browser test page that dumps out all mouse events
This commit is contained in:
parent
438c5bce6c
commit
6c31f6c073
2 changed files with 23 additions and 0 deletions
22
Base/res/html/misc/mouse-events.html
Normal file
22
Base/res/html/misc/mouse-events.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<style>
|
||||||
|
#rect {
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
border: 5px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id=rect></div>
|
||||||
|
<pre id=out></pre>
|
||||||
|
<script>
|
||||||
|
function handle(e) {
|
||||||
|
var out = document.getElementById('out');
|
||||||
|
out.innerHTML = e.type + ' @ ' + e.offsetX + ',' + e.y + '\n' + out.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rect = document.getElementById('rect');
|
||||||
|
rect.onmousedown = handle;
|
||||||
|
rect.onmousemove = handle;
|
||||||
|
rect.onmouseup = handle;
|
||||||
|
rect.onclick = handle;
|
||||||
|
rect.ondblclick = handle;
|
||||||
|
</script>
|
|
@ -135,6 +135,7 @@
|
||||||
|
|
||||||
<h2>JavaScript/Wasm</h2>
|
<h2>JavaScript/Wasm</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><a href="mouse-events.html">mouse events</a></li>
|
||||||
<li><a href="message-channel.html">MessageChannel</a></li>
|
<li><a href="message-channel.html">MessageChannel</a></li>
|
||||||
<li><a href="websocket.html">WebSocket API Test</a></li>
|
<li><a href="websocket.html">WebSocket API Test</a></li>
|
||||||
<li><a href="cookie.html">document.cookie</a></li>
|
<li><a href="cookie.html">document.cookie</a></li>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue