Sticky header with jquery

后端 未结 2 541
滥情空心
滥情空心 2020-12-29 14:21

I would like to create multiple two sticky headers just like in that website: http://www.trendyol.com/Kappa/ButikDetay/8690 When you scroll down, the first header combines w

相关标签:
2条回答
  • 2020-12-29 14:41

    The way this is accomplished is pretty easy. You check the scroll position and if it is below a certain number you display a fixed position element at the top (and hide when the scroll position goes backup).

    That being said there is a great plugin that can help: https://github.com/imakewebthings/jquery-waypoints

    With demo exactly what you want: http://imakewebthings.com/jquery-waypoints/sticky-elements/

    AS an update from one of the comments, http://stickyjs.com might be a more supported library.

    0 讨论(0)
  • 2020-12-29 14:43

    use position:sticky to make sticky.

    Here is the article explained.

    0 讨论(0)
提交回复
热议问题