How do I get a fixed position div to scroll horizontally with the content? Using jQuery

后端 未结 3 702
暗喜
暗喜 2020-11-27 06:04

I have a div.scroll_fixed with the following CSS

.scroll_fixed {
    position:absolute
    top:210px

}
.scroll_fixed.fixed {
    position:fixed;
    top:0;
         


        
3条回答
  •  情歌与酒
    2020-11-27 06:29

    use css property position:sticky to get it.

    Here is the article explained and live demo.

    http://updates.html5rocks.com/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit

    the only drawback is browser compatibility.

提交回复
热议问题