mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:18:13 +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>
|
Loading…
Add table
Add a link
Reference in a new issue