main.js:1 Uncaught ReferenceError: $ is not defined
at main.js:1
jqueryとつながりません。なぜでしょうか?
====================================html===========================================
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title></title> <link rel="stylesheet" href="main.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> </head> <body></body> </html><main> <div id="btn_box"> <button>ボタン1</button> <button>ボタン1</button> <button>ボタン2</button> <button>ボタン2</button> <button>ボタン3</button> <button>ボタン3</button> </div> </main> <script src="main.js"></script>
====================================jQuery===========================================
$(function(){
var duration = 300; $('button') .on('mouseover', function() { $(this).stop(true).animate({ backgroundColor: '#ae5e9b', color: '#fff' }, duration); }) .on('mouseout', function(){ $(this).stop(true).animate({ backgroundColor: '#fff', color: '#ebc000' }, duration); });
});
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/30 08:00
2019/04/30 08:37 編集
2019/04/30 08:37