http://www.blueidea.com/user/myhyli原创代码->选取效果,或以下代码<HTML xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
<STYLE>v\:* { behavior: url(#default#VML);} </STYLE>
<body>
<script>
var obj
function document.onmousedown(){
obj=document.body.appendChild(document.createElement("v:rect"))
with(obj.style){
position="absolute"
top=window.event.clientY
left=window.event.clientX
}
obj.setCapture();
}
function document.onmousemove(){
if(obj==null)return;
with(obj.style){
try{width=window.event.clientX-parseInt(left)}catch(e){}
try{height=window.event.clientY-parseInt(top)}catch(e){}
}
}
function document.onmouseup(){
obj.releaseCapture();
obj=null;
}
</script>