質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -62,4 +62,10 @@
|
|
62
62
|
|
63
63
|
|
64
64
|
|
65
|
+
|
66
|
+
|
67
|
+
hoge();
|
68
|
+
|
69
|
+
|
70
|
+
|
65
71
|
```
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -17,3 +17,49 @@
|
|
17
17
|
sw.style.background = "#78bd78";
|
18
18
|
|
19
19
|
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
### 回答をいただいて
|
26
|
+
|
27
|
+
順番的には以下の様になっています。
|
28
|
+
|
29
|
+
```javascript
|
30
|
+
|
31
|
+
コード
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
function hoge(){
|
36
|
+
|
37
|
+
insertElement += "<div id=\"switchArea\" onclick=\"on_off_B()\">";
|
38
|
+
|
39
|
+
insertElement += "<div id=\"swImg\"></div>";
|
40
|
+
|
41
|
+
insertElement += "</div>";
|
42
|
+
|
43
|
+
//以下省略
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
function on_off_B(){
|
50
|
+
|
51
|
+
var sw = document.getElementById("swImg");
|
52
|
+
|
53
|
+
sw.style.webkitTransform = "translateX(70px)";
|
54
|
+
|
55
|
+
sw.style.background = "#78bd78";
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
hoge();
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```
|