Six_Actual Posted May 29, 2019 Share Posted May 29, 2019 I am trying to make my div (floating-sidebar) appear at the top when the user scrolls down the page, and once the user scrolls to the top, the element should not overlap the nav bar. I am struggling to implement this, so help would be appreciated. This is what I have tried: <div id="floating-sidebar-sticky-wrapper" class="floating-sidebar-wrap" style="height: 696px;"> <div id="floating-sidebar"></div> </div> <script> $(window).on('load',function(){ $("#floating-sidebar").sticky({ topSpacing: 0, wrapperClassName: "floating-sidebar-wrap" }); }); </script> Quote Link to comment https://forums.phpfreaks.com/topic/308768-sticky-element-to-top-on-scroll/ Share on other sites More sharing options...
Barand Posted May 29, 2019 Share Posted May 29, 2019 Let's leave it to stackoverflow to to answer before we waste our time on you. Quote Link to comment https://forums.phpfreaks.com/topic/308768-sticky-element-to-top-on-scroll/#findComment-1567128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.