[英]how to move side menu with jquery along with top bar
How can I make the side menu which is on the right scroll down when the bookmark bar gets to it, and then move along with the bookmark bar with jquery, and not knowing that menu is moving, it's like it stood stay still. 当书签栏到达菜单栏时,如何使右侧菜单向下滚动,然后使用jquery与书签栏一起移动,而又不知道菜单栏是否在移动,就好像它静止不动一样。
You'll need to: 您需要:
$(window).scroll
event $(window).scroll
事件 scrollTop
at the sidebars .offset().top
scrollTop
在侧边栏.offset().top
position: fixed
position: fixed
position: relative
position: relative
check out this tutorial: Scroll/Follow Sidebar 查看本教程: 滚动/跟随侧边栏
It uses a combination of CSS and jQuery to do what you need. 它结合使用CSS和jQuery来完成您需要的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.