1、DIV盒子里嵌入
iframe框架,调用gg.html页面
<div align="center">
<iframe id="main" style="width:100%;" name="main" src="
gg.html" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" οnlοad="Javascript:setFrameHeight(this)"></iframe>
//方法一(经测试发现,方法一有时不起作用,建议用方法二)
<script language="javascript">
<script language="javascript">
<!--
function setFrameHeight(obj){
var win=obj;
if (document.getElementById)
{
if (win && !window.opera)
{
if (win.contentDocument && win.contentDocument.body.offsetHeight)
win.height = win.contentDocument.body.offsetHeight+"px";
else if(win.Document && win.Document.body.scrollHeight)
win.height = win.Document.body.scrollHeight+"px";
}
}
}
-->
</script>
//方法二
<script type="text/javascript">
</script>
//方法二
<script type="text/javascript">
//注意:下面的代码是放在和iframe同一个页面中调用
$("#mainFrame").load(function () {
var mainheight = $(this).contents().find("body").height() + 30;
$(this).height(mainheight);
});
</script>
</div>
2、gg.html页面的代码:
2、gg.html页面的代码:
<a href="#" target="_blank"><img src="gg/pic1.gif" width="100%" height="60" style="margin-left: 0px;margin-top: 10px"/></a>
<a href="#" target="_blank"><img src="gg/
pic2
.gif" width="100%" height="60" style="margin-left: 0px;margin-top: 10px"/></a>
<a href="#" target="_blank"><img src="gg/
pic3
.gif
" width="100%" height="60" style="margin-left: 0px;margin-top: 10px"/></a>
<a href="#" target="_blank"><img src="gg/
pic4
.gif
" width="100%" height="60" style="margin-left: 0px;margin-top: 10px"/></a>
<a href="#" target="_blank"><img src="gg/
pic5
.gif
" width="100%" height="60" style="margin-left: 0px;margin-top: 10px"/></a>