Support » Plugin: Ajaxify WordPress Site(AWS) » When posts load, you can't see the top – have to scroll up

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author manishkrag

    (@manishkrag)

    you have to use scrollto function in ajaxify.js file

    I don’t understand. Am I making changes to the ajaxify.js file? What would I change?

    Hello!
    Please explain in detail how to use scrollto function.

    Plugin Author manishkrag

    (@manishkrag)

    $content.html(contentHtml)
    .ajaxify()
    .css('text-align', '')
    .animate({opacity: 0, visibility: "visible"}).animate({opacity: 1},800);

    Replace above code by below:

    $content.html(contentHtml)
    .ajaxify()
    .css('text-align', '')
    .animate({opacity: 1, visibility: "visible"})
    .animate({scrollTop: $("#' + container_id").offset().top }, 2000);

    Hope this will solve you guys problem 🙂

    For some reason I made that change but the behavior does not seem to be different at all.

    Here’s how I create page scroll
    The file ajaxify.js find string

    / / Complete the change
    if ($ body.ScrollTo | | false) $ body.ScrollTo (scrollOptions);

    and above the insert

    jQuery ('html, body'). animate ({scrollTop: 0}, 0);

    Sorry for my english
    If anything is unclear, please contact me try to explain.

    I think I did what you just suggested…but still, it does not scroll to the top? The behavior seems unchanged.

    Can you try it and tell me what you see? http://www.team3309.org

    In your file ajaxify.js, no line jQuery(‘html,body’).animate({scrollTop: 0}, 0); // Scroll the page up

    That’s what I did – I inserted the line

    jQuery ('html, body'). animate ({scrollTop: 0}, 0);

    right above

    / / Complete the change
    if ($ body.ScrollTo | | false) $ body.ScrollTo (scrollOptions);

    This script tried to disconnect

    <script type="text/javascript">
    function window_onload() {
      window.addEventListener("scroll",navbar_reset_top,false);
    }
    var navbar_top=210;
    function navbar_reset_top() {
      var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
      if(scrollTop>navbar_top&&access.className==="navbar_absolute") {
        document.getElementById("access").className="navbar_fixed";
      }
      else if(scrollTop<navbar_top&&access.className==="navbar_fixed") {
        document.getElementById("access").className="navbar_absolute";
      }
    }
    </script>

    Possible conflict of what that script.

    So you think my navbar script is interfering with the page scrolling? Any suggestions on a fix?

    I checked your file ajaxify.js on my site it does not work. Try to set my file

    Works perfectly! Thank you so much.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘When posts load, you can't see the top – have to scroll up’ is closed to new replies.