mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
Base: Add a browser test page that dumps out all mouse events
This commit is contained in:
parent
438c5bce6c
commit
6c31f6c073
Notes:
sideshowbarker
2024-07-17 19:40:25 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6c31f6c073d
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>
|
||||
<ul>
|
||||
<li><a href="mouse-events.html">mouse events</a></li>
|
||||
<li><a href="message-channel.html">MessageChannel</a></li>
|
||||
<li><a href="websocket.html">WebSocket API Test</a></li>
|
||||
<li><a href="cookie.html">document.cookie</a></li>
|
||||
|
|
Loading…
Reference in a new issue