删除IE的滚动条 [英] Removing IE's scrollbar
问题描述
首先,我不想只是删除它,我想确保仍有滚动功能也有。
这是因为我想在网站上有一个幻灯片放映的效果,你可以点击下一步和之前,
我已在其他浏览器中隐藏了滚动条:
:: - webkit-scrollbar {
display:none;
}
用于webkit浏览器和 overflow:-moz-scrollbars - 无;
for Firefox。
我在互联网上找到了这些:
scrollbar-3dlight-color :;
scrollbar-arrow-color :;
scrollbar-base-color :;
scrollbar-darkshadow-color :;
scrollbar-face-color :;
scrollbar-highlight-color :;
scrollbar-shadow-color :;
我想通过将颜色更改为 transparent
,它会消失,但它没有(只是恢复正常)。
有一种方法,我可以简单地隐藏滚动条(就像 display:none
或其他) IE?我对 css
和 js
开放。
问题的问题
注意: / strong>单击时,添加
标签。 overflow:hidden;
会阻止页面跳过第二个 div
c> a
使用您当前的代码查看此处
尝试此招
body,div,html {
height :100%;
width:100%;
padding:0;
margin:0;
}
body {
overflow:hidden;
position:fixed;
}
div {
overflow-y:scroll;
position:relative;
right:-20px;
}
它抵消了一个可滚动的div,所以它的垂直滚动条在可视区域之外。 / p>
First of all, I don't want to just remove it, I want to ensure that there is still scrolling capabilities there also.
This is because I would like to have a 'slide show' affect on the website, where you can click 'next' and before, however with the scroll bar there, you can just go through it.
I have hidden the scrollbar in other browsers using:
::-webkit-scrollbar {
display: none;
}
for webkit browsers and overflow: -moz-scrollbars-none;
for Firefox. However, when it comes to IE, I can't find anything to simply hide it.
I found these on the internet:
scrollbar-3dlight-color:;
scrollbar-arrow-color:;
scrollbar-base-color:;
scrollbar-darkshadow-color:;
scrollbar-face-color:;
scrollbar-highlight-color:;
scrollbar-shadow-color:;
I thought by changing the colour to transparent
, it would disappear, but it did not (just reverts back to normal).
Is there a way I can simply hide the scrollbar (simply like display:none
or something else), in IE? I am open to css
and js
options.
NOTE: Adding overflow:hidden;
stops the page from going past the second div
when clicking the a
tag.
See here for fiddle using your current code
Try this trick
body, div, html{
height:100%;
width:100%;
padding:0;
margin:0;
}
body{
overflow:hidden;
position:fixed;
}
div{
overflow-y:scroll;
position:relative;
right:-20px;
}
It offsets a scrollable div so its vertical scrollbar is outside the viewable area.
这篇关于删除IE的滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!