Search code examples
javascriptwordpresswordpress-themingsidebar

Side bar isn't fixed


first of all this is the website I am talking about: Be Better You.net

Everything up to here is awesome, the problem is when I click on one of the categories in the right side bar. I get to a new page for e.g. This Page, and the problem is that the side-bar isn't fixed as it is on the front page. ( it's somewhat relative to the post's length)

I've tried for over 2 hours editing the style.css file, but no luck. Style.css code


Solution

  • Edit this code in your functions.js

    function scroll() {
               // var windowPos = $window.scrollTop();
               var windowPos = $('body').scrollTop(); 
    

    or use this variable

    var windowPos = $('html').scrollTop();