首页javascriptdrawing_settingsCanvas - 如何在画布上隐藏鼠标

Canvas - 如何在画布上隐藏鼠标

我们想知道如何在画布上隐藏鼠标。


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<style type='text/css'>
    canvas{border:1px solid red;}
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
     $("#theCanvas").click(function () {
         alert("You clicked the canvas with an invisible mouse!");
         $("#theCanvas").css("cursor", "none");
     });
});//]]>  
</script>
</head>
<body>
   <p">Click the red canvas and I'll hide the cursor when you are over me</p>
   <canvas id="theCanvas"></canvas>
</body>
</html>