在jquery中不使用画布就可以通过mousemove绘制线条吗
使用画布,我们可以在鼠标移动时绘制线条。我需要知道,在jquery中不使用鼠标画布事件是否可以画线。我认为这是可能的: 使用以下命令:在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
<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