JS用鼠标画线,但如何改变线条的颜色呢? 参考这个里面的组件Canvas功能,有图形绘制库www.joyistar.com 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 StrokeColor;----------------------color = "red";var s='<v:line from="'+lastX+','+lastY+'" to="'+event.x+','+event.y+'" style="position:absolute;left:0px;top:0px;" StrokeColor="'+color+'"></v:line>'; 不可能把下面的存一下<?xml version="1.0" encoding="gb2312" standalone="yes"?><html xmlns:v="http://www.eglic.com/"><head><title></title><meta name="Generator" content="EditPlus" /><meta name="Author" content="eglic" /><meta name="ContentType" content="text/html" /><meta name="CharSet" content="GB2312" /><link rel="stylesheet" type="text/css" href="/style/default.css" /><style type="text/css">v\:* {behavior:url(#default#VML);}</style><script language="javascript" src="/script/default.js"></script><script language="javascript">var Working=false;var lastX=0;var lastY=0;var color= "blue";document.ondblclick=function (){if(!Working) return;lastX=0;lastY=0;Working=false;}document.onclick=function (){if(!Working){Working=true;lastX=event.x;lastY=event.y;}else{var s='<v:line from="'+lastX+','+lastY+'" to="'+event.x+','+event.y+'" style="position:absolute;left:0px;top:0px;" StrokeColor="'+color+'"></v:line>';lastX=event.x;lastY=event.y;var o=document.createElement(s);document.body.insertAdjacentElement('BeforeEnd',o);}}document.onmousemove=function (){if(!Working) return;}</script></head><body></body></html> var s='<v:line from="'+lastX+','+lastY+'" to="'+event.x+','+event.y+'" style="position:absolute;left:0px;top:0px;" StrokeColor="red"></v:line>';看看可以不 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html xmlns:v="urn:schemas-microsoft-com:vml"><head><title>test</title></head><STYLE> v\:* { BEHAVIOR: url(#default#VML) }</STYLE><body><v:line style="position:relative" from="0,0" to="100,100" strokecolor="red"></v:line></body></html> to: ice_berg16(寻梦的稻草人) 不好意思,原来是我把 StrokeColor这个词拼错了,谢谢你 菜鸟请教关于jquery tools的问题 IE8,IE9 JS获取屏幕分辨率不正确 为什么不能实现侧边栏和主体内容跳转啊 求大侠指导一下 自定义标签属性如何兼容? 奇怪的问题,让JS代码失效 如何获得拖动层的id 树状列表在本机调试的时候,显示不正常;用IE浏览的时候却正常.怎么回事啊? checkbox变色问题谢谢在线等 用哪种算法javascript对地址栏中得参数进项加密 如何将一个层中的所有内容按照层中的布局导出到WORD里? 怎样在网页中打开Word文档? 如何让一个DIV层(非图)看起来像渐渐消失
----------------------
color = "red";
var s='<v:line from="'+lastX+','+lastY+'" to="'+event.x+','+event.y+'" style="position:absolute;left:0px;top:0px;" StrokeColor="'+color+'"></v:line>';
把下面的存一下<?xml version="1.0" encoding="gb2312" standalone="yes"?>
<html xmlns:v="http://www.eglic.com/">
<head>
<title></title>
<meta name="Generator" content="EditPlus" />
<meta name="Author" content="eglic" />
<meta name="ContentType" content="text/html" />
<meta name="CharSet" content="GB2312" />
<link rel="stylesheet" type="text/css" href="/style/default.css" />
<style type="text/css">
v\:* {behavior:url(#default#VML);}
</style>
<script language="javascript" src="/script/default.js"></script>
<script language="javascript">
var Working=false;
var lastX=0;
var lastY=0;
var color= "blue";
document.ondblclick=function (){
if(!Working) return;
lastX=0;
lastY=0;
Working=false;
}
document.onclick=function (){
if(!Working){
Working=true;
lastX=event.x;
lastY=event.y;
}else{
var s='<v:line from="'+lastX+','+lastY+'" to="'+event.x+','+event.y+'" style="position:absolute;left:0px;top:0px;" StrokeColor="'+color+'"></v:line>';
lastX=event.x;
lastY=event.y;
var o=document.createElement(s);
document.body.insertAdjacentElement('BeforeEnd',o);
}
}
document.onmousemove=function (){
if(!Working) return;
}
</script>
</head>
<body>
</body>
</html>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>test</title>
</head>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<body>
<v:line style="position:relative" from="0,0" to="100,100" strokecolor="red"></v:line>
</body>
</html>