Merge pull request #66 from CustomButtons/Auto_scroll
Auto scroll console text fixed
This commit is contained in:
commit
2f08757a5b
3 changed files with 6 additions and 4 deletions
|
@ -55,9 +55,9 @@
|
|||
</textarea>
|
||||
|
||||
<script>
|
||||
area.onmousedown = function(e) { this.value += "mousedown\n"; this.scrollTop = 1e9; };
|
||||
area.onmouseup = function(e) { this.value += "mouseup\n"; this.scrollTop = 1e9; };
|
||||
area.onclick = function(e) { this.value += "click\n"; this.scrollTop = 1e9; };
|
||||
area.onmousedown = function(e) { this.value += "mousedown\n"; this.scrollTop = this.scrollHeight; };
|
||||
area.onmouseup = function(e) { this.value += "mouseup\n"; this.scrollTop = this.scrollHeight; };
|
||||
area.onclick = function(e) { this.value += "click\n"; this.scrollTop = this.scrollHeight; };
|
||||
</script>
|
||||
```
|
||||
[/online]
|
||||
|
|
|
@ -2,10 +2,12 @@ table.onmouseover = function(event) {
|
|||
var target = event.target;
|
||||
target.style.background = 'pink';
|
||||
text.value += "mouseover " + target.tagName + "\n";
|
||||
text.scrollTop = text.scrollHeight;
|
||||
};
|
||||
|
||||
table.onmouseout = function(event) {
|
||||
var target = event.target;
|
||||
target.style.background = '';
|
||||
text.value += "mouseout " + target.tagName + "\n";
|
||||
text.scrollTop = text.scrollHeight;
|
||||
};
|
|
@ -10,7 +10,7 @@ function handler(event) {
|
|||
log.value += event.type + ': ' +
|
||||
'target=' + str(event.target) +
|
||||
', relatedTarget=' + str(event.relatedTarget) + "\n";
|
||||
log.scrollTop = 1e9;
|
||||
log.scrollTop = log.scrollHeight;
|
||||
|
||||
if (event.type == 'mouseover') {
|
||||
event.target.style.background = 'pink'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue