数据库中遍历的数组css怎么自适应高度

html-css011

数据库中遍历的数组css怎么自适应高度,第1张

css 自适应高度

如果你是表格的话 就直接设置每页的高度就好了

如果你是全部调用出来的

css 你可以使用 height:100%或者height:auto

window.onload=function(){

var o=document.getElementById("main")

edittemp(o)

function edittemp(o){

var arr=[]

arr.push("width")

arr.push("height")

for(var i=0i<arr.lengthi++){

var id=arr[i]

var obj=document.getElementById(id)

obj.onkeyup=function(j){

return function(){

if(isNaN(this.value)){

alert('只能输入数字!')

this.value=''

return

}

if(j == 'width'){

o.style.width = parseInt(this.value)+'px'

}else if(j == 'height'){

o.style.height = parseInt(this.value)+'px'

}

}

}(id)

}

}

}

</script>

<body>

<div id="main" style="width:200pxheight:100pxborder:1px solid #f00"></div>

<br>

<input id="width" name="" type="text">

<input id="height" name="" type="text">

试试!!

你是要显示隐藏吧

$(function () {

var type = $(":radio")

var content = $("#content td")

type.click(function () {

content.hide()

$(content[type.index($(this))]).show()

})

})