[英]jquery on scroll change the menu bar height and logo
how can I check if the user scrolls down? 如何检查用户是否向下滚动? I have a menubar at the top of the page with a logo. 我在页面顶部有一个带有徽标的菜单栏。 And if the user scrolls down I want to resize or change the logo (smaller), change the height of the menu bar and make the position fixed. 如果用户向下滚动,我要调整大小或更改徽标(较小),请更改菜单栏的高度并固定位置。
Thanks 谢谢
Try this 尝试这个
window.onscroll = function (e) { //when window is scrolled
//change image size and height of menu bar
}
Try this 尝试这个
$(window).on('scroll', function(e) {
console.log(e);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.