Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a scrollable container to the domeventviewer #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions wheel-event-viewer.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
.hilite_target {
.hilite_div_a {
background-color: #c0ffc0;
padding: 0 10px;
}

#target {
.hilite_div_b {
background-color: #ffc0ff;
padding: 0 10px;
}

.hilite_div_c {
background-color: #c0ffff;
padding: 0 10px;
}


#div_a {
background-color: #c0ffc0;
border: 1px solid black;
margin: 10px 30px;
padding: 20px;
display: inline-block;
}

#div_b {
background-color: #ffc0ff;
border: 1px solid black;
margin: 10px 30px;
padding: 10px;
height: 80px;
overflow: scroll;
display: inline-block;
}

#div_c {
background-color: #c0ffff;
border: 1px solid black;
margin: 10px 30px;
padding: 20px;
display: inline-block;
}

#scrollable {
height: 100vh;
}
2 changes: 1 addition & 1 deletion wheel-event-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Wheel Event Viewer</h1>

<p>UserAgent: <span id="useragent"></span></p>

<div id="target"> Scroll here </div>
<div id="div_a"> Scroll here <div id="div_b"> B <div id="div_c"> C </div> <div id="scrollable"> </div> </div> </div>

<p>
<input id="resetTable" type="button" onclick="resetTable();return false" value="Clear Table"/>
Expand Down
4 changes: 3 additions & 1 deletion wheel-event-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var _wheel_table_info = [
["deltaY", "wheel", "text"],
["deltaZ", "wheel", "text"],
["deltaMode", "wheel", "text"],
["target", "wheel", "text"],
], {
'checked': true,
'header-background': "#c0f0c0"
Expand Down Expand Up @@ -111,7 +112,7 @@ function init() {
injectCustomCSS(_wheel_event_info, _wheel_table_info);
resetTable();

var target = document.getElementById("target");
var target = document.getElementById("div_a");
addEventListener(target, "mousedown", onMouseDown);
addEventListener(target, "mouseup", onMouseUp);
addEventListener(target, "wheel", onWheel);
Expand Down Expand Up @@ -191,6 +192,7 @@ function addMouseEvent(etype, e) {
eventinfo["deltaX"] = e.deltaX;
eventinfo["deltaY"] = e.deltaY;
eventinfo["deltaZ"] = e.deltaZ;
eventinfo["target"] = e.target.id;

var deltaMode = "-";
if (etype == "wheel") {
Expand Down