<style>
#resize1 {
position : absolute;
border: 0px solid black;
height: 10px;
width: 50px;
overflow: hidden;
background-color: #ffffff;
top : 250px;
left: 100px;
}
#resize2 {
position : absolute;
border: 0px solid black;
height: 100px;
width: 50px;
overflow: hidden;
background-color: #85f285;
top : 350px;
left: 200px;
}
#resize3 {
position : absolute;
border: 0px solid black;
height: 100px;
width: 50px;
overflow: hidden;
background-color: #85f285;
top : 350px;
left: 300px;
}
</style><div id="resize1">
</div>
<div id="resize2">
</div>
<div id="resize3">
</div>
这里的resize元素的个数是个变量,跟据文件里读进来的决定。也就是需要用循环来写,相应地div也得循环来写,谁能帮我写个例子啊,谢谢啦。
#resize1 {
position : absolute;
border: 0px solid black;
height: 10px;
width: 50px;
overflow: hidden;
background-color: #ffffff;
top : 250px;
left: 100px;
}
#resize2 {
position : absolute;
border: 0px solid black;
height: 100px;
width: 50px;
overflow: hidden;
background-color: #85f285;
top : 350px;
left: 200px;
}
#resize3 {
position : absolute;
border: 0px solid black;
height: 100px;
width: 50px;
overflow: hidden;
background-color: #85f285;
top : 350px;
left: 300px;
}
</style><div id="resize1">
</div>
<div id="resize2">
</div>
<div id="resize3">
</div>
这里的resize元素的个数是个变量,跟据文件里读进来的决定。也就是需要用循环来写,相应地div也得循环来写,谁能帮我写个例子啊,谢谢啦。
解决方案 »
- js创建节点的通用方法 研读
- 关于JS内存泄露问题,我找到了一个处理方法,可是运行速度超级慢,有人能帮我出个点子吗?
- uncaught exception: Invalid dimensions for plot, width = null, height = null,高手救
- 高分简单问题,在线等。。。
- 对fck熟悉的进
- 请问效果为什么出不来?
- 在线文章编辑器的问题~高手来看看,谢啦!在线等!
- 如何将这个vbs函数改写成js的
- 菜鸟提问:如何在js中实现如csdn中那种在1024x768下自动居中
- 试验了一下js中闭包的概念,发现没有达到我的预期,请教一下!
- document.createNodeIterator+ Firefox/3.0.15报错
- frameset中 如何禁用鼠标右键,禁止另存为,禁止查看源文件
.tbcss{border:solid 1px #f0f; margin:0px;padding:0px;}
.tbcss tr td{margin:5px; padding:5px; border:solid 1px #0f0;}你的resize元素就相当于td,
<table class="tbcss"><tr><td></td></tr></table>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style> </style>
</head><body>
</body>
<script>
// 插入样式
function insertCSS(sheet, selector, declare, index){
if(sheet.insertRule){
var insert = selector + '{' + declare + '}';
sheet.insertRule(insert, index);
}else if(sheet.addRule){
sheet.addRule(selector, declare, index);
}
} // 制造假数据
var styles = [
{selector: '.resize1', declare: 'width:100px;height:100px;border:1px solid red'},
{selector: '.resize2', declare: 'border:1px solid blue'},
{selector: '.resize3', declare: 'border:1px solid yellow'}
]; (function(){
// 第一段样式表
var x = document.styleSheets[0], fragment = document.createDocumentFragment();
for(var i = 0; i < styles.length; i++){
// 插入样式到样式表
var style = styles[i];
insertCSS(x, style.selector, style.declare, i);
// 生成DIV 并对应样式
var odiv = document.createElement('div');
odiv.innerHTML = "test";
odiv.className = style.selector.replace('.','');
fragment.appendChild(odiv);
} document.body.appendChild(fragment);
})();</script>
</html>
proxy: true,
hiddenHandles:true,
handles: ['t']
});是要跟上面定义的resize1关联的,实现resize,可是现在没有能拖动的效果了,该怎么解决啊