移除框架滚动条

3
我是一个有用的助手,可以翻译文本。
我设计了一个带有框架的网页。这是我的作业,所以我必须使用框架。 在我的页面中有很多框架,内部框架有滚动条。我需要将其移除,该如何移除?
这是我的main.html代码:
<frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
    <frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<!-- Interior Frame -->
    <frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
        <frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
        <frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
            <frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
            <frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
        </frameset>
    </frameset>
<!-- Interior Frame -->
    <frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
</frameset>

这是我的页面外观:

enter image description here

http://download.cnet.com/YouTube-To-MP3/3000-2071_4-75810474.html>转换YouTube视频至MP3

有几个可以使用的CSS技巧,但需要进行测试。你能分享一个链接或演示吗? - Ignacio Correia
这是我的代码文件。你可以下载它。http://www.2shared.com/file/KbHG4YTT/site.html - user983924
5个回答

3

只需在框架的主要html文件中添加以下内容:

scrolling="no"

因此,结果如下:
<frame scrolling="no" src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" >

这是您的 main.html 结果:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>
<title></title>
<meta name="keywords" content="Webpage, design, yumakli" />
<meta name="description" content="Yumakli koyu web sayfasi" />
<style type = "text/css">
frame{
    overflow:hidden;
}
</style>
</style>
<script></script>
</head>
<div style="width:5000; height:5000;">
<frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
    <frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize"  scrolling="no">
<!-- Interior Frame -->
    <frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
        <frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize"  scrolling="no">
        <frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
            <frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
            <frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
        </frameset>
    </frameset>
<!-- Interior Frame -->
    <frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize"  scrolling="no">
</frameset>
</div>
</html>

在这种情况下,我无法看到整个页面。我需要移除内部滚动条。整个页面可以包含该滚动条,而不是内部框架。 - user983924
这是另一个问题,请发布另一个问题。而且你一开始在主页面上没有滚动条。这个问题已经解决了。 - Ignacio Correia
谢谢,但我已经知道如何使用滚动了,它实际上不能解决我的问题。也许我必须在我的问题中提到具体情况。 - user983924

2
只需在对象上设置overflow: hidden;即可:
#objectID {
    overflow: hidden;
}

注意:请使用您的对象ID更改objectID

您也可以尝试:

frame{
    overflow:hidden;
}

这可能有效... 如果你尝试一下也不会有坏处 :)

祝好运!


1
它不会改变任何东西 :( - user983924
你能提供你的网站链接吗?这样我就可以使用Firebug并找到解决方法了。谢谢。 - Eliran Efron
这是我的代码文件。您可以下载它。谢谢。2shared.com/file/KbHG4YTT/site.html - user983924
好的,你需要做的就是在每个“frame”标签上添加“scrolling =“ no””。这很容易。 但请注意:您将获得框架内项目的完整宽度(这就是为什么有滚动条的原因)。 希望我能帮到你 :) - Eliran Efron

0
在您的框架中添加一个名为scrolling的属性,并将其值设置为no

http://www.w3schools.com/tags/att_frame_scrolling.asp

编辑:

另一个选项是在您当前创建的框架周围添加另一个框架集

发现于这个问题并为您进行了调整。

文件index.html:

<html>
    <frameset rows="1,480" frameborder="NO" border="0" noresize="noresize" scrolling="yes">
        <FRAME SRC="javascript:<HTML></HTML>" NAME="dummy" FRAMEBORDER="NO" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="NO">
        <FRAME SRC="main.html" NAME="scrollcontent" FRAMEBORDER="NO" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="yes">
    </frameset>
</html>

文件 main.html

<html><frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
    <frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<!-- Interior Frame -->
    <frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
        <frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
        <frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
            <frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
            <frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
        </frameset>
    </frameset>
<!-- Interior Frame -->
    <frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
</frameset>
</html>

看看这个对你是否有效。


但在这种情况下,我无法获取整个页面。 - user983924

0

好的,你需要做的就是在每个'frame'标签上添加:scrolling="no"

这很容易。

但请注意:你将获得框架内项目的完整宽度(这就是为什么会出现滚动条)

希望能帮到你 :)


0
在主页上写入
frame::-webkit-scrollbar
{
    display: none;
}

 /* Hide scrollbar for IE, Edge and Firefox */
frame ,frameset {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    padding: 0px;
    margin: 0px;
 }

去框架页面
body::-webkit-scrollbar 
   {
       display: none;
   }

 /* Hide scrollbar for IE, Edge and Firefox */
body 
{
     -ms-overflow-style: none;  /* IE and Edge */
     scrollbar-width: none;  /* Firefox */
     padding: 0px;
     margin: 0px;
 }

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接