Home  >  Article  >  Web Front-end  >  JS line drawing (example code)_javascript skills

JS line drawing (example code)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:13:551251browse

IE下画线

复制代码 代码如下:




 
 


from='200,200' 
to='300,100' 
style='position:absolute;z-index:8'> 
 

<script><br>var R =function(){};<br>R.prototype.createLine = function (startX,startY,endX,endY){  <br>  var le = document.createElement( "<v:line><v:line>" );  <br>  le.from = startX ',' startY ;  <br>  le.to = endX ',' endY ;  <br>  le.strokecolor= "red" ;  <br>  le.strokeweight= "1pt" ;  <br>  return le;  <br>}  <br>var d =new R();<br>document.body.appendChild(d.createLine(1,1,200,100));<br></script>


FF下画线
复制代码 代码如下:


 
  A canvas fillRect, strokeRect and clearRect example
 
 
 
 
 

 
 


 
 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn