日期:2014-05-17  浏览次数:20714 次

请叫关于去掉iframe的滚动条,主窗口使用滚动条的问题!
HTML code
<BODY style="margin:0;padding:0;">
   <iframe id="iframe" width="0" height="0" scrolling="Auto" frameborder="0" marginwidth="0" marginheight="0" ></iframe>
   <SCRIPT LANGUAGE="JavaScript">  
   var f= document.getElementById("iframe");
   f.src="http://www.163.com";
   f.width="100%";
   f.height="100%";
   </SCRIPT>
</BODY>




代码在这,scrolling值是"Auto",像163这个页面高度,就会有滚动条,这样加上浏览器本身的滚动条就有两个
我想去掉iframe的滚动条,而使用浏览器的滚动条。

如果scrolling设置为NO,那么虽然只有浏览器的滚动条,但不启作用求解!


------解决方案--------------------
L@_@K
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title> new document </title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="generator" content="editplus" />
    <meta name="author" content="yixianggao@126.com" />
    <meta name="keywords" content="" />
    <meta name="description" content="" />
<style type="text/css">
html {
    overflow: auto;
}
</style>
</head>

<BODY style="margin:0;padding:0;">
   <iframe id="iframe" width="0" height="0" scrolling="Auto" frameborder="0" marginwidth="0" marginheight="0" ></iframe>
   <SCRIPT LANGUAGE="JavaScript">  
   var f= document.getElementById("iframe");
   f.src="http://www.163.com";
   f.width="100%";
   f.height="100%";
   </SCRIPT>
</BODY>

</html>

------解决方案--------------------
HTML code

<iframe src="http://www.163.com" id="iframe" scrolling="Auto" width="100%" frameborder="0" marginwidth="0" marginheight="0" ></iframe>
<script language="javascript">
    document.getElementById("iframe").height=document.getElementById("iframe").document.documentElement.clientHeight-4;
</script>

------解决方案--------------------
<iframe src="http://www.163.com" id="iframe" scrolling="no" width="100%" frameborder="0" marginwidth="0" marginheight="0" onload="this.height=document.getElementById('iframe').contentWindow.document.body.scrollHeight+10;"></iframe>