웹에서그림그리기
페이지 정보
작성자 서방님 댓글 0건 조회 77회 작성일 07-08-08 11:08본문
예제 : http://www.kaiser.pe.kr/java/script/script104/script1041.htm
퍼온곳 : 자월(자바월드)주소 : http://www.kaiser.pe.kr/
소스 :
<html xmlns:v='urn:schemas-microsoft-com:vml'>
<head>
<style>
v:* {behavior:url(#default#VML);}
</style>
</head>
<body id=board topmargin=0 leftmargin=0>
<v:line id=lines style='position:absolute;' from='0px,0px' to='0px,0px' strokeweight='1px' strokecolor='black'/>
</body>
<script>
var flag=false
function drawLine(){
flag=true;
board.innerHTML+="n<v:line id=lines style='position:absolute;' from='"+leftP+"px,"+topP+"px' to='"+leftP+"px,"+topP+"px' strokeweight='1px' strokecolor='black'/>"
}
function initPosition(){
leftP=event.clientX
topP=event.clientY
if(flag){document.all.lines[document.all.lines.length-1].to=leftP+"px,"+topP+"px"}
}
function drawEnd(){
flag=false
}
document.onmousedown=drawLine;
document.onmousemove=initPosition;
document.onmouseup=drawEnd;
</script>
</html>
퍼온곳 : 자월(자바월드)주소 : http://www.kaiser.pe.kr/
소스 :
<html xmlns:v='urn:schemas-microsoft-com:vml'>
<head>
<style>
v:* {behavior:url(#default#VML);}
</style>
</head>
<body id=board topmargin=0 leftmargin=0>
<v:line id=lines style='position:absolute;' from='0px,0px' to='0px,0px' strokeweight='1px' strokecolor='black'/>
</body>
<script>
var flag=false
function drawLine(){
flag=true;
board.innerHTML+="n<v:line id=lines style='position:absolute;' from='"+leftP+"px,"+topP+"px' to='"+leftP+"px,"+topP+"px' strokeweight='1px' strokecolor='black'/>"
}
function initPosition(){
leftP=event.clientX
topP=event.clientY
if(flag){document.all.lines[document.all.lines.length-1].to=leftP+"px,"+topP+"px"}
}
function drawEnd(){
flag=false
}
document.onmousedown=drawLine;
document.onmousemove=initPosition;
document.onmouseup=drawEnd;
</script>
</html>
댓글목록
등록된 댓글이 없습니다.