JS的左右两列自动拉伸对齐
来源:互联网 发布:$windows.~bt 编辑:程序博客网 时间:2024/06/05 09:42
"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>
<script type="text/javascript">
function alignHeight(eleA,eleB){
if(!document.getElementById(eleA)){return false;}
if(!document.getElementById(eleB)){return false;}
var heightA = document.getElementById(eleA).clientHeight;
var heightB = document.getElementById(eleB).clientHeight;
if(heightA > heightB){
document.getElementById(eleB).style.height = heightA + "px";
document.getElementById(eleA).style.height = heightA + "px";
}else{
document.getElementById(eleA).style.height = heightB + "px";
document.getElementById(eleB).style.height = heightB + "px";
}
}
window.onload =
function z_align(){
alignHeight("left","right"); //只需将需要对齐的两个模块的id写在此处即可。
//alignHeight("AAA","BBB") 可依此连续多组。
}
</script>
<style type="text/css">
#main{width:400px}
div{border:1px solid #666;padding:10px;}
#left{float:left;width:150px}
#right{float:right;width:180px}
</style>
</head>
<body>
<div id="main">
<div id="left">高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高高</div>
<div id="right">我自动跟他对齐</div>
</div>
</body>
</html>
- JS的左右两列自动拉伸对齐
- JS_布局_的左右两列自动拉伸对齐
- 转载:三行两列的自动对齐列高(来自51asp.com)
- 典型的左右结构(两列)的网页模式
- DIV+CSS左右两列自适应高度的方法
- 可拖动拉伸的左右分栏效果
- Flex布局实现圣杯布局,左右两列固定、中间列自适应的三列式布局
- CSS左右两列布局宽度100%
- CSS左右两列自适应高
- CSS左右两列自适应高
- DIV+CSS左右两列自适应高度
- 带左右箭头切换的自动滚动图片JS特效
- UIButton 的图片自动拉伸
- 左右两列且可收缩的流式布局框架--Jquery于Div/Css结合
- 【CSS+Html】解决左右浮动的两列内容,随浏览宽度变化而自适应?
- jq-ui的Sortable插件 两列布局 左右拖拽
- table 左右拉伸效果
- js实现盒子的拉伸
- 对J2EE平台的理解
- Excel 动态选择区域
- DirectX 9高层着色语言介绍1——引言、简单例子、汇编语言和编译对象
- 散列表
- 如何提高网站的访问速度
- JS的左右两列自动拉伸对齐
- 解决openfire在使用MySQL数据库后的中文乱码问题(转)
- C++ Virtual详解
- 服务器变量的一点总结
- 2010年11月刊
- 全面分析Java的垃圾回收机制
- BS与CS的联系与区别
- Wireshark过滤器使用规则介绍
- identifier of an instance of from 1 to 1