请问高手我怎么可以用鼠标在屏幕上拖动画一个方框呀 风云舞:FlashVml(璀灿之星)4.0发布 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 zhaoxiaoyang(梅雪香@深圳) 您好 我知道你是个高手请你说得详细些好吗 <html xmlns:v="urn:schemas-microsoft-com:vml"><head><STYLE>v\:* { Behavior: url(#default#VML) }</STYLE><script language="JavaScript"><!--var x=0;var y=0;var isMouseDown=false;var newRect=null;document.onmousedown=function(){ x=window.event.clientX; y=window.event.clientY; isMouseDown=true; newRect=document.createElement('<v:rect filled="false" style="position:absolute;top:'+y+';left:'+x+';width:0;height:0"></v:rect>');// alert(newRect.outerHTML); document.body.insertBefore(newRect);}document.onmousemove=function(){ if(isMouseDown==false) return; var mx=window.event.clientX; var my=window.event.clientY; if(mx>x){ newRect.style.width=mx-x; } else{ newRect.style.width=x-mx; newRect.style.left=mx; } if(my>y){ newRect.style.height=my-y; } else{ newRect.style.height=y-my; newRect.style.top=my; }}document.onmouseup=function(){ x=0; y=0; isMouseDown=false;}//--></script></head><body onselectstart="return false;"></body></html> To zhaoxiaoyang(梅雪香@深圳)请你修改一下你的源代码好吗,怎么修改边框的宽度和颜色呀,而且使方框每次画一个,即画第二个方框时,第一个消失 非常感谢呀 jquery UI进度条或自己写的进度条都没法达到预期效果,难道js是真的无法解决这问题? 声明对象时的小问题 把一个安装文件打包成CAB js问题 AJAX+XML不能立即刷新的问题 這樣的replace用正則表達式可以嗎? QQ一样的web聊天程式,新消息如何更新? 如何用javascript输出一个HTML标签? DIV移动的问题 <script>里面有退出或是return吗?可以这么用吗? 怎样通过JavaScript的onclick为文本框赋值 请教大家一个简单的问题:关于复选框的
请你说得详细些好吗
<head>
<STYLE>
v\:* { Behavior: url(#default#VML) }
</STYLE>
<script language="JavaScript">
<!--
var x=0;
var y=0;
var isMouseDown=false;
var newRect=null;document.onmousedown=function(){
x=window.event.clientX;
y=window.event.clientY;
isMouseDown=true;
newRect=document.createElement('<v:rect filled="false" style="position:absolute;top:'+y+';left:'+x+';width:0;height:0"></v:rect>');
// alert(newRect.outerHTML);
document.body.insertBefore(newRect);
}
document.onmousemove=function(){
if(isMouseDown==false) return;
var mx=window.event.clientX;
var my=window.event.clientY;
if(mx>x){
newRect.style.width=mx-x;
}
else{
newRect.style.width=x-mx;
newRect.style.left=mx;
}
if(my>y){
newRect.style.height=my-y;
}
else{
newRect.style.height=y-my;
newRect.style.top=my;
}}
document.onmouseup=function(){
x=0;
y=0;
isMouseDown=false;
}//-->
</script>
</head>
<body onselectstart="return false;"></body>
</html>
请你修改一下你的源代码好吗,怎么修改边框的宽度和颜色呀,而且使方框每次画一个,即画第二个
方框时,第一个消失
非常感谢呀