小编jmi*_*ing的帖子

鼠标移动时如何使功能工作?

$(document).ready(function() {
    var score = 0;

    $("body").mousemove(function() {        
        score++;
        $("#result").val(score);
        console.log(score);
    });

 });
Run Code Online (Sandbox Code Playgroud)

每次移动鼠标时分数都会增加,但是当鼠标不移动时,我应该如何添加一个功能来将分数降低到0?

html javascript jquery html5 web

11
推荐指数
1
解决办法
182
查看次数

标签 统计

html ×1

html5 ×1

javascript ×1

jquery ×1

web ×1