This commit is contained in:
Ilya Kantor 2015-07-13 16:25:25 +03:00
commit 6160d38f35
4 changed files with 7 additions and 5 deletions

View file

@ -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]

View file

@ -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;
};

View file

@ -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'