vml!有开发过的吗?急需您的帮忙! 这个对你有用:http://community.csdn.net/Expert/topic/3810/3810715.xml?temp=.7833216 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 rect可以放在一个div内,拖动div的时候,rect会跟着移动<html xmlns:v><style>v\:*{behavior:url(#default#VML);position:relative;left:10px;top:10px;width:200px;height:200px;}div{background-color:green;position:absolute;left:10px;top:50px;width:230px;height:230px;border-width:2px;border-color:red;border-style:solid;t:expression(this.ondragstart=function(){startDrag(this)});e:expression(this.ondragend=function(){endDrag(this)});}</style><script>var start_x=0;var start_y=0;var end_x=0;var end_y=0;function startDrag(obj){ start_x=obj.style.left; start_y=obj.style.top;}function endDrag(obj){ end_x=event.x; end_y=event.y; obj.style.left+=(end_x-start_x); obj.style.top+=(end_y-start_y); }</script><body><div><v:rect fillcolor="red"/></div></body></html> 先拖动div的绿色边缘一次,这时整个div处于选中状态,然后拖动rect 不好意思,改了一下:<html xmlns:v><style>v\:*{behavior:url(#default#VML);position:relative;left:10px;top:10px;width:200px;height:200px;}div{background-color:green;position:absolute;left:10px;top:50px;width:230px;height:230px;border-width:2px;border-color:red;border-style:solid;t:expression(this.ondragstart=function(){startDrag(this)});e:expression(this.ondragend=function(){endDrag(this)});}</style><script>var start_x=0;var start_y=0;var end_x=0;var end_y=0;function startDrag(obj){ start_x=obj.currentStyle.left; start_y=obj.currentStyle.top;}function endDrag(obj){ end_x=event.clientX; end_y=event.clientY; obj.style.left=(parseInt(obj.currentStyle.left)+end_x-parseInt(start_x)).toString()+'px'; obj.style.top=(parseInt(obj.currentStyle.top)+end_y-parseInt(start_y)).toString()+'px';}</script><body><div><v:rect fillcolor="red"/></div></body></html> 哦。。可以了:)我是把它放在div里<div><v:rect fillcolor="red"/></div>,但没给div样式,可是我不明白为什么要有样式?我那样为什么不能直接选中div而拖动它? 不必定义div样式,只是测试的时候单纯的只有rect不好拖动:)<html xmlns:v><style>v\:*{behavior:url(#default#VML);position:relative;left:10px;top:10px;width:200px;height:200px;t:expression(this.ondragstart=function(){startDrag(this)});e:expression(this.ondragend=function(){endDrag(this)});}</style><script>var start_x=0;var start_y=0;var end_x=0;var end_y=0;function startDrag(obj){ start_x=obj.currentStyle.left; start_y=obj.currentStyle.top;}function endDrag(obj){ end_x=event.clientX; end_y=event.clientY; obj.style.left=(parseInt(obj.currentStyle.left)+end_x-parseInt(start_x)).toString()+'px'; obj.style.top=(parseInt(obj.currentStyle.top)+end_y-parseInt(start_y)).toString()+'px';}</script><body><div><v:rect fillcolor="red"/></div></body></html> 哦,明白了:)t:expression(this.ondragstart=function(){startDrag(this)});e:expression(this.ondragend=function(){endDrag(this)});这两句是什么意思?不太明白阿 vivianfdlpw(),你还在马?如果两个矩形间用直线相连,如何保证拖动时线动态跟随物体? 谢谢,分不够可以再加,vml实在陌生。 好的,谢谢你。[email protected] 想让页面加载时指定的文本框自动获得焦点 Microsoft JScript 运行时错误: 没有权限 《Java王者归来》 谁有? 月影写的 xml 导入 时 不进入onreadystatechange事件 求助`````````` 问个 Dreamweaver MX 与 五笔 的兼容性问题 请问能否去掉下拉框里面的滚动条? 请问搞手一个元素TD的问题? CheckBox 如何实现全选? 关于用零客户端做mis的疑惑!欢迎大家来讨论! js怎么判断用户拖动了滚动条 select怎么会没有title 属性? 100分!!!在新闻库内容字段中取图片文件名???
<style>
v\:*
{
behavior:url(#default#VML);
position:relative;left:10px;top:10px;width:200px;height:200px;
}
div
{
background-color:green;position:absolute;left:10px;top:50px;
width:230px;height:230px;
border-width:2px;border-color:red;border-style:solid;
t:expression(this.ondragstart=function(){startDrag(this)});
e:expression(this.ondragend=function(){endDrag(this)});
}
</style>
<script>
var start_x=0;
var start_y=0;
var end_x=0;
var end_y=0;
function startDrag(obj)
{
start_x=obj.style.left;
start_y=obj.style.top;
}function endDrag(obj)
{
end_x=event.x;
end_y=event.y;
obj.style.left+=(end_x-start_x);
obj.style.top+=(end_y-start_y);
}
</script>
<body>
<div>
<v:rect fillcolor="red"/>
</div>
</body>
</html>
<style>
v\:*
{
behavior:url(#default#VML);
position:relative;left:10px;top:10px;width:200px;height:200px;
}
div
{
background-color:green;position:absolute;left:10px;top:50px;
width:230px;height:230px;
border-width:2px;border-color:red;border-style:solid;
t:expression(this.ondragstart=function(){startDrag(this)});
e:expression(this.ondragend=function(){endDrag(this)});
}
</style>
<script>
var start_x=0;
var start_y=0;
var end_x=0;
var end_y=0;
function startDrag(obj)
{
start_x=obj.currentStyle.left;
start_y=obj.currentStyle.top;
}function endDrag(obj)
{
end_x=event.clientX;
end_y=event.clientY;
obj.style.left=(parseInt(obj.currentStyle.left)+end_x-parseInt(start_x)).toString()+'px';
obj.style.top=(parseInt(obj.currentStyle.top)+end_y-parseInt(start_y)).toString()+'px';
}
</script>
<body>
<div>
<v:rect fillcolor="red"/>
</div>
</body>
</html>
<html xmlns:v>
<style>
v\:*
{
behavior:url(#default#VML);
position:relative;left:10px;top:10px;width:200px;height:200px;
t:expression(this.ondragstart=function(){startDrag(this)});
e:expression(this.ondragend=function(){endDrag(this)});
}
</style>
<script>
var start_x=0;
var start_y=0;
var end_x=0;
var end_y=0;
function startDrag(obj)
{
start_x=obj.currentStyle.left;
start_y=obj.currentStyle.top;
}function endDrag(obj)
{
end_x=event.clientX;
end_y=event.clientY;
obj.style.left=(parseInt(obj.currentStyle.left)+end_x-parseInt(start_x)).toString()+'px';
obj.style.top=(parseInt(obj.currentStyle.top)+end_y-parseInt(start_y)).toString()+'px';
}
</script>
<body>
<div>
<v:rect fillcolor="red"/>
</div>
</body>
</html>
t:expression(this.ondragstart=function(){startDrag(this)});
e:expression(this.ondragend=function(){endDrag(this)});
这两句是什么意思?不太明白阿