前提・実現したいこと
jQueryでアニメーションを制作しています。
mouseoverで背景色を紫に変化させ、mouseoutでもとに戻したいのですが、うまく動作してくれません。
発生している問題・エラーメッセージ
背景色が変化しない
該当のソースコード
jQuery
1 $(function () { 2 var duration = 300, 3 defaultColor = '#3498DB', 4 changeColor = '#ae5e9b'; 5 6 $(".s10w button:nth-child(-n+3)").on({ 7 'mouseover': function () { 8 $(this).stop(true).animate({ 9 backgroundColor: changeColor 10 }, duration); 11 }, 12 'mouseout': function () { 13 $(this).stop(true).animate({ 14 backgorundColor: defaultColor 15 }, duration); 16 } 17 }); 18 });
試したこと
jshintを利用した文法チェック
補足情報(FW/ツールのバージョンなど)
回答3件
あなたの回答
tips
プレビュー