私は迷路を作成し、ホバーで機能しない理由がわかりません。
$('.wall')
.bind('mouseenter', function() {
$(this).css({
'background-color': 'green'
});
})
ここにフィドルリンクがあります:
私は迷路を作成し、ホバーで機能しない理由がわかりません。
$('.wall')
.bind('mouseenter', function() {
$(this).css({
'background-color': 'green'
});
})
ここにフィドルリンクがあります:
これをjsfiddleで使用します:
html にこれを追加します。
<script type="text/javascript" src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
そしてスクリプトでこれを行います:
$(document).ready(function(){
$(document).on("mouseenter",".wall",function(){
$(this).css({
'background-color': 'green'
});
});
$(document).on('mouseleave',".wall", function () {
$(this).css({
'background-color': ''
});
});
});