开发者

How to remove the double scroll?

I want to make facebook-style image viewer. It was ok when I had only image in the viewer and height of it wasn't bigger than 100%. But when I added description to images it become bigger, so that it took to scroll the viewer. After adding scroller to viewer it becomes two scrollers.

I looked to facebook, only viewer scrolling in there, body (under layer) are fixed. How to get this behavior?

css of viewer container

#gallary-container {
    bottom: 0;
    left: 0;
    overflow-x: auto;
    overflow-y: scroll;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, .5);
    color: 开发者_运维技巧white;
}

edit:

Actually question, how to disable scroller on body of page leave it only on viewer?


You should be able to set

overflow:hidden;

on the box that gets the scrollbars


It was easy! I created class

.htmlfixed{
    overflow: hidden;
    height: 100%;
}

And appointed it to html tag in js.


You can try this.

<style>
  html {
    overflow-y: hidden;
  }
</style>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜