Scrollbar appears through CSS animation/transition

后端 未结 4 1701
悲哀的现实
悲哀的现实 2021-01-01 12:20

I am animating my ng-view in Angular with a cubic-bezier transition:

/* Animations */
.slide-animation.ng-enter, .slide-animation.ng-leave           


        
4条回答
  •  执笔经年
    2021-01-01 12:54

    You need to set overflow:hidden in the body css. But note that, adding this will hide all overflown contents including the vertical scroll bar and you dont want to do that since the page contents will be hidden if the height is overflown. So if you are using a slide transition (sidewards) and you only want to hide the horizontal scroll bar that appears during transition, then use this instead:

     body {
        overflow-x:hidden;  
    }
    

    This way, you are only hiding the horizontal scroll bar and the vertical scroll bar will still work.

提交回复
热议问题