
<html>
<head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8" />
<title>demo</title>
<style type="text/css">
*{margin:0padding:0}
.box{width:300pxheight:30pxbackground:#da251a}
.click1{width:120pxheight:30pxline-height:30pxtext-align:centercolor:#fffbackground:#000margin-bottom:10px cursor:pointer}
.click2{width:120pxheight:30pxline-height:30pxtext-align:centercolor:#fffbackground:#000cursor:pointer}
</style>
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(".click1").click(function(){
var bHeight=$(".box").height()
bHeight+=30
$(".box").css("height",bHeight)
})
$(".click2").click(function(){
var bHeight=$(".box").height()
bHeight-=30
$(".box").css("height",bHeight)
})
})
</script>
</head>
<body>
<div class="click1">增加</div>
<div class="click2">减少</div>
<div class="box"></div>
</body>
</html>
自己把对应的jq库文件引入下即可。
写的不好,请谅解!
修改div高度,可以直接给div的width赋值即可。
下面是小例子,仅供参考:
<style type='text/css'>#div2 {
width:200px
height:200px
background:red
border:1px solid black
}
</style>
<script>
function toGreen(){
var oDiv=document.getElementById('div2')
oDiv.style.width='300px'
oDiv.style.height='300px'
oDiv.style.background='green'
}
</script>
<body>
<div id='div2' onmouseover='toGreen()' >
</div>
1.筛选的条件不固定(筛选的高度不固定),数据不多的情况下所加起来的高度不超过页面显示的高度,正常显示;2.如果数据超多,数据显示的高度加起来超过了当前页面的高度,table出现滚动条,页面不出现滚动条,分页组件依然可以显示
搜索条件
js中封装好的table的高度
将table的高度js文件单独引入页面,或者挂载到全局方法
table中高度的使用
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)