回答編集履歴
1
追記
test
CHANGED
@@ -57,3 +57,65 @@
|
|
57
57
|
|
58
58
|
|
59
59
|
```
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
# 追記
|
64
|
+
|
65
|
+
```HTML
|
66
|
+
|
67
|
+
<script>
|
68
|
+
|
69
|
+
document.addEventListener ('mouseover',function(e){myfunc(e)});
|
70
|
+
|
71
|
+
document.addEventListener ('mouseout',function(e){myfunc(e)});
|
72
|
+
|
73
|
+
document.addEventListener ('mousemove',function(e){myfunc(e)});
|
74
|
+
|
75
|
+
function myfunc(e){
|
76
|
+
|
77
|
+
var t=e.target;
|
78
|
+
|
79
|
+
if(t.nodeName=="DIV" && t.className.match(/(^| )tooltip-body( |$)/)){
|
80
|
+
|
81
|
+
switch(e.type){
|
82
|
+
|
83
|
+
case "mouseover":
|
84
|
+
|
85
|
+
console.log(t.innerHTML+' over!');
|
86
|
+
|
87
|
+
break;
|
88
|
+
|
89
|
+
case "mouseout":
|
90
|
+
|
91
|
+
console.log(t.innerHTML+' out!')
|
92
|
+
|
93
|
+
break;
|
94
|
+
|
95
|
+
case "mousemove":
|
96
|
+
|
97
|
+
console.log(t.innerHTML+' move!');
|
98
|
+
|
99
|
+
break;
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
</script>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div class="hoge tooltip-body fuga" style="width:100px;height:100px;background-Color:yellow">yellow</div>
|
112
|
+
|
113
|
+
<div class="tooltip-body hoge" style="width:100px;height:100px;background-Color:lime">lime</div>
|
114
|
+
|
115
|
+
<div class="tooltip-body" style="width:100px;height:100px;background-Color:aqua">aqua</div>
|
116
|
+
|
117
|
+
<div class="hoge" style="width:100px;height:100px;background-Color:red">red</div>
|
118
|
+
|
119
|
+
```
|
120
|
+
|
121
|
+
※red領域にはtooltip-bodyクラスが設定されていないので反応しない
|