日期:2014-05-16  浏览次数:20525 次

请问怎样设置画线的颜色?
以下是用来画线的,我想把线的颜色设为红色,请问怎样设?

  <script   language= "javascript "> var   Working=false;
var   points   =   [];
var   lastPoint   =   {x:0,y:0};

document.body.scrollLeft=document.body.offsetWidth;

function   drawCanvas()
{
var   arr   =   eval(req.responseText);
            var   x1   =   arr[0];
var   y1   =   arr[1];
if(!Working){
document.getElementById( "show ").style.display= "none ";
Working=true;
lastPoint.x   =   x1;
lastPoint.y   =   y1;
points.push(   {x:x1,y:y1}   );

}else{
var   s= ' <v:line   from= " '+lastPoint.x+ ', '+lastPoint.y+ ' "   to= " '+x1+ ', '+y1+ ' "   style= "color:red;position:absolute;left:0px;top:0px; "> </v:line> ';
lastPoint.x   =   x1;
lastPoint.y   =   y1;
points.push(   {x:x1,y:y1}   );

var   o=document.createElement(s);
document.body.insertAdjacentElement( 'BeforeEnd ',o);
}
}
</script>

------解决方案--------------------
strokecolor= "#5af85a "