-1

私は迷路を作成し、ホバーで機能しない理由がわかりません。

$('.wall')
.bind('mouseenter', function() {
    $(this).css({
        'background-color': 'green'
    });
})

ここにフィドルリンクがあります:

http://jsfiddle.net/uqcLn/6/

4

1 に答える 1

2

これを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': ''
        });
    });
});
于 2013-10-05T02:13:31.917 に答える