一个页面,分别用table中处理的,一共一个tr,2个td,每个td都加载了iframe,我现在想在中间增加一个td,当鼠标点击这个td的时候,实现拖动的效果,然后动态改变左右td的大小,要怎么处理啊?
解决方案 »
- 你可能不知道的10个JavaScript小技巧 作者:梦想
- window.showModalDialog与其他jquery文件有冲突怎么解决啊?
- !!有什么用
- <<<window.top.close()>>>能不能直接关闭窗口而不出现系统的“正在关闭窗口”……
- js怎样转换编码?谢谢!
- jquery调用日历如何使用this来定义日历要显示到哪里啊?
- 求教关于javascript的网页计数器问题
- 如何在程序中更改页面的地址?
- 各位JavaScript都来帮帮小弟,再做不出来,就要下岗了?
- 正则问题???
- 如何用javascript模拟csdn网站右下角的自动弹出框?
- 问一个关于javascript对象的问题。
举例
<table>
<tr><td width="200px">左TD</td><td onmousedown="ini(this);" onmousemove="changewidth(this);" width="300px">移动的比较快,小心点</td><td width="200px">右TD</td></tr>
</table>
<script>
window.document.onmouseup=function(){d=false;};
var x;
var d=false;
function ini(o)
{
x=event.screenX;
d=true;
o.style.border="1px solid red";
}
function changewidth(o){if(d)o.previousSibling.width=((parseInt(o.previousSibling.width)+event.screenX-x)<0)?1:parseInt(o.previousSibling.width)+event.screenX-x;}
</script>
<div></div>
<table>
<tr><td width="200px">左TD</td><td onmousedown="ini(this);" onmousemove="changewidth(this);" width="300px">移动的比较快,小心点</td><td width="200px">右TD</td></tr>
</table>
<script>
window.document.onmouseup=function(){d=false;};
var x;
var d=false;
function ini(o)
{
x=event.offsetX;
d=true;
o.style.border="1px solid red";
}
function changewidth(o){if(d)o.previousSibling.width=(parseInt(o.previousSibling.width)+event.offsetX-x)<0?1:parseInt(o.previousSibling.width)+event.offsetX-x;}
</script>
<div></div>
建议换成一个DIV中间套3个TABLE的 或者中间套3个DIV的