jquery 代码一
$("#ipersonalinfo").load(function() {
$(this).height($(this).contents().height());
})
代码 二
<script type=”text/网页特效”>
//iframe 自适应高度
function setcwinheight(){
var bobo=document.getelementbyid(”main”); //iframe id
if (document.getelementbyid){
if (bobo && !window.opera){
if (bobo.contentdocument && bobo.contentdocument.body.offsetheight){
bobo.height = bobo.contentdocument.body.offsetheight;
}else if(bobo.document && bobo.document.body.scrollheight){
bobo.height = bobo.document.body.scrollheight+30;
//alert(document.getelementbyid(”amdright”).style.width);
}
}
}
}
</script>
<iframe id=”main” name=”main” src=”main.php教程” scrolling=”no” width=”100%” frameborder=”0′ onload=”setcwinheight()”></iframe>
方法二
<script type="text/javascript">
function resizecontent()
{
$(window.parent.document).find("#if1").height($("#content").height());
}function show400()
{
if($("#test400").css教程("display") == "none")
{
$("#test400").css("display","");
resizecontent();
}
else
{
$("#test400").css("display","none");
resizecontent();
}
}
$(document).ready(function(){
resizecontent();
})
</script>