流水

前端页面右侧出现两个滚动条的bug怎么办

今天熬夜赶(抄)一个前端的项目,遇到了一个bug,这不是frame、iframe,也没截图。

不仅有伤大雅而且我看着很难受,而且滚动有限制,往上滑到一个section的顶部的时候,滑轮再向上就滑不动了,应该是判断这是网页顶部了。

在我处理完之后,我搜了一下这个问题,也顺便回答了一下,贴一下他的图。

这个其实很容易解决,用三行css代码

body{overflow:hidden}
html{/*overflow-y:scroll;*/ }
html{overflow: auto; }

 

也看到了其他回答,比如

body::-webkit-scrollbar {
    display:none
}
这个也是可以实现的,就是直接隐藏侧边滚动栏,直接全都不显示。。

74 thoughts on “前端页面右侧出现两个滚动条的bug怎么办

  1. Thank you for the good writeup. It in truth used to be
    a leisure account it. Look complicated to more introduced agreeable from you!
    However, how could we keep up a correspondence?

  2. Heya i’m for the first time here. I found this board and I find It truly useful & it helped me out much.
    I hope to give something back and aid others like you helped me.

  3. Simply want to say your article is as astounding. The clearness for your
    publish is simply great and i could suppose you’re an expert in this subject.
    Fine together with your permission let me to clutch your feed to keep up to date with approaching
    post. Thanks one million and please carry on the gratifying work.

  4. You actually make it appear really easy together with your presentation but I find this
    matter to be really something which I feel I would never understand.
    It kind of feels too complex and very huge for me.
    I’m having a look ahead for your next put up, I’ll attempt to get the grasp of it!

  5. I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.

    nonetheless, you command get got an edginess over that
    you wish be delivering the following. unwell unquestionably come more formerly again since exactly
    the same nearly very often inside case you shield this hike.

  6. I don’t even understand how I finished up here, however I believed this
    post was great. I don’t recognize who you are however certainly you are going to a famous blogger in case you are not already.
    Cheers!

  7. You’ve made some good points there. I looked on the net for more
    information about the issue and found most individuals will go along with your views on this website.

  8. It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant blog!
    I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to fresh updates and will share this site with my Facebook group.
    Chat soon!

  9. Magnificent beat ! I would like to apprentice even as you amend your web site, how could i subscribe for a weblog
    website? The account aided me a applicable deal. I had been tiny bit
    familiar of this your broadcast offered shiny clear idea

  10. What i do not understood is in truth how you’re not actually a lot
    more smartly-liked than you may be right now.
    You are so intelligent. You understand therefore significantly when it comes to
    this topic, produced me for my part consider it
    from so many various angles. Its like women and men aren’t
    involved unless it is something to do with Woman gaga!
    Your own stuffs nice. At all times deal with it up!

发表评论

电子邮件地址不会被公开。 必填项已用*标注

答案 : *
18 + 5 =


返回顶部