始终显示浏览器滚动条prevent页跳转 [英] Always show browser scrollbar to prevent page jumping

查看:163
本文介绍了始终显示浏览器滚动条prevent页跳转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/4050076/how-to-always-show-scrollbar-in-browser-using-javascript\">How要使用JavaScript始终显示在浏览器中的滚动条?


有些我也有很多其他的内容网页上的几行,所以,当我在页面之间点击一些网页对浏览器滚动条和别人不一样。正因为如此页之间,当点击页面跳转所有的时间,由于额外的空间。

时有可能有滚动条可见在任何时候,或灰色,如果没有大量的内容,制止页面跳跃?

它可以在所有浏览器,希望有人能帮助,

干杯


解决方案

尝试阅读本<一个href=\"http://css-tricks.com/eliminate-jumps-in-horizontal-centering-by-forcing-a-scroll-bar/\">article由克里斯·Coyer,它解释它pretty很好。

从文章:


  

分配溢出-Y滚动不工作,它在Firefox的作​​品,
  Safari和IE 6,这使得它最好的解决办法:


  HTML {
    溢出-Y:滚动;
}

Possible Duplicate:
How to always show scrollbar in browser using javascript?

Some pages I have have lots of content other pages have a few lines, so when I am clicking between pages some pages have a scrollbar on the browsers and others don't. Because of this the page jumps all the time due to the extra space when clicking between pages.

Is it possible to have the scrollbar visible at all times, or greyed out if there is not a lot of content to stop the jumping of pages?

Can it work across all browsers, hope someone can help,

Cheers

解决方案

Try reading this article by Chris Coyer, it explains it pretty well.

From the article:

Assigning overflow-y to scroll does work, and it works in Firefox, Safari, and IE 6, and that makes it the best solution:

html {
    overflow-y: scroll; 
}

这篇关于始终显示浏览器滚动条prevent页跳转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆