开发者

Forcing a horizontal scrollbar in IE8

开发者 https://www.devze.com 2023-03-10 22:40 出处:网络
I have a client that wants a scrollbar on top of their content.So I made an empty div, placed it on top of the real content, added a scroll bar and bound the scrolling of the fake div and the empty on

I have a client that wants a scrollbar on top of their content. So I made an empty div, placed it on top of the real content, added a scroll bar and bound the scrolling of the fake div and the empty one together using javascript. This all works great in every browser... except IE8. IE8 doesn't show my scrollbar in my empty div (technically it has an   in it) no matter what I try.

demo: http://jsfiddle.net开发者_C百科/cwolves/NShGP/

<div class="mock-scroller">
    <div class="mock-content" style="width:2000px;">&nbsp;</div>
</div>

.mock-scroller {
    position   : absolute;
    top        : 0px;
    left       : 0px;
    width      : 274px;
    height     : 20px;
    overflow-x : auto;
    overflow-y : hidden;
}


Perhaps overflow-x : scroll;?

Forcing a horizontal scrollbar in IE8

0

精彩评论

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