Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在jquery中不使用画布就可以通过mousemove绘制线条吗_Jquery_Html_Canvas - Fatal编程技术网

在jquery中不使用画布就可以通过mousemove绘制线条吗

在jquery中不使用画布就可以通过mousemove绘制线条吗,jquery,html,canvas,Jquery,Html,Canvas,使用画布,我们可以在鼠标移动时绘制线条。我需要知道,在jquery中不使用鼠标画布事件是否可以画线。我认为这是可能的: 使用以下命令: <html> <head> <title> Bob the Painter </title> <style type="text/css"> td{ width:10px; /*Change it As You want */ height:10p

使用画布,我们可以在鼠标移动时绘制线条。我需要知道,在jquery中不使用鼠标画布事件是否可以画线。

我认为这是可能的:

使用以下命令:

    <html>
    <head>
    <title> Bob the Painter </title>
    <style type="text/css">
    td{
    width:10px; /*Change it As You want */
    height:10px;
    background:#ffffff;
    border:0px;
    cursor:crosshair;
    }
    </style>
    <script type="text/javascript">
    function drawLine(x){
    x.style.background="#000000"; /* Use Color Picker for More Colors */
    }
    function drawmyTable(x,y){
    var ground=document.getElementById("html");
    var p="<table border=1 cellspacing=0 cellpadding=0>";
    for(var i=0;i<x;i++){
    p+="<tr>";
    for(var j=0;j<y;j++){
    p+="<td onMouseOver='drawLine(this);'></td>";
    }
    p+="</tr>";
    } 
    p+="</table>";
    ground.innerHTML+=""+p+"";
    }
    </script>
    </head>
    <body OnLoad="drawmyTable(50,50);" id="html">
    </body>
    </html>

画家鲍勃
运输署{
宽度:10px;/*根据需要进行更改*/
高度:10px;
背景:#ffffff;
边界:0px;
光标:十字线;
}
功能抽绳(x){
x、 style.background=“#000000”/*使用颜色选择器获取更多颜色*/
}
函数drawmyTable(x,y){
var ground=document.getElementById(“html”);
var p=“”;
对于(var i=0;i