###わからないことと
jQuery最高の教科書という本でjqueryを勉強していて、本に書いてあるボタンを自分で作ろうとしましたが、
うまくできませんでした。
・マウスオーバーすると出てくるborderが丸くない。
・ボタンの中の文字が動いてしまう。
jQueryやcssは本当に苦手で、初歩的な質問ですが、回答お願いします。
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>jQuery</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <style> body { background: #ebc000; } .button { width: 200px; height: 70px; text-align: center; line-height: 70px; border-radius: 10px; border: 0px solid #ae5e9b; background: #fff; color: #ebc000; box-sizing: border-box; } .button:hover { cursor: pointer; } </style> </head> <body> <div class="button">mouseover</div> <script> $(function() { $('.button') .on('mouseover', function() { $(this).stop(true).animate({ borderWidth: '12px', color: '#ae5e9b' },300, 'easeOutSine'); }) .on('mouseout', function() { $(this).stop(true).animate({ borderWidth: '', color: '#ebc000' },300, 'easeOutSine'); }); }); </script> </body> </html>
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/30 03:25