回答編集履歴

2

修正

2017/03/30 02:04

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -1,4 +1,12 @@
1
+ - マウスオーバーすると出てくるborderが丸くない。
2
+
1
- `borderRadius`を追加すると質問者さんの希望通りの動作が実現できると思います
3
+ `borderWidth`の値変更。`10px`より小さくする。
4
+
5
+ - ボタンの中の文字が動いてしまう。
6
+
7
+ `button`クラスにかかっている`line-height`プロパティをコメントアウト。
8
+
9
+
2
10
 
3
11
  ```HTML
4
12
 
@@ -20,8 +28,6 @@
20
28
 
21
29
  <style>
22
30
 
23
-
24
-
25
31
  body {
26
32
 
27
33
  background: #ebc000;
@@ -38,7 +44,7 @@
38
44
 
39
45
  text-align: center;
40
46
 
41
- line-height: 70px;
47
+ /* line-height: 70px; */
42
48
 
43
49
  border-radius: 10px;
44
50
 
@@ -66,43 +72,35 @@
66
72
 
67
73
  <body>
68
74
 
69
-
70
-
71
- <div class="button">mouseover</div>
75
+ <button class="button">mouseover</button>
72
-
73
-
74
76
 
75
77
  <script>
76
78
 
77
79
  $(function () {
78
80
 
79
- $('.button')
81
+ $(".button")
80
82
 
81
- .on('mouseover', function () {
83
+ .on("mouseover", function () {
82
84
 
83
85
  $(this).stop(true).animate({
84
86
 
85
- borderWidth: '12px',
87
+ borderWidth: "8px",
86
88
 
87
- borderRadius: "15px",//ここを追加。
89
+ color: "#ae5e9b"
88
90
 
89
- color: '#ae5e9b'
90
-
91
- }, 300, 'easeOutSine');
91
+ }, 300, "easeOutSine");
92
92
 
93
93
  })
94
94
 
95
- .on('mouseout', function () {
95
+ .on("mouseout", function () {
96
96
 
97
97
  $(this).stop(true).animate({
98
98
 
99
- borderWidth: '',
99
+ borderWidth: "0px",
100
100
 
101
- borderRadius: "10px",//ここを追加。
101
+ color: "#ebc000"
102
102
 
103
- color: '#ebc000'
104
-
105
- }, 300, 'easeOutSine');
103
+ }, 300, "easeOutSine");
106
104
 
107
105
  });
108
106
 

1

修正

2017/03/30 02:04

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -98,7 +98,7 @@
98
98
 
99
99
  borderWidth: '',
100
100
 
101
- borderRadius: "",//ここを追加。
101
+ borderRadius: "10px",//ここを追加。
102
102
 
103
103
  color: '#ebc000'
104
104