jQuery scroll position history in infinite scroll when go back to previous page
<p>Suppose I scrolling down to the 18/50 of my <code>&lt;div&gt;</code> on my Index page then I go to another page in the same tab and go back to previous page. </p>

<p>How do I make a scroll down to the same position on 18/50 of my <code>&lt;div&gt;</code>?</p>

<p><strong>scroll.js</strong></p>

<pre><code>var ajax_arry = [];
var ajax_index = 0;
var sctp = 100;
$(function () {
    $('#loading').show();
    $.ajax({
        url: "scroll.php",
        type: "POST",
        data: "actionfunction=showData&amp;page=1",
        cache: false,
        success: function (response) {
            $('#loading').hide();
            $('#demoajax').html(response);

        }

    });
    $(window).scroll(function () {

        var height = $('#demoajax').height();
        var scroll_top = $(this).scrollTop();
        if (ajax_arry.length &gt; 0) {
            $('#loading').hide();
            for (var i = 0; i &lt; ajax_arry.length; i++) {
                ajax_arry[i].abort();
            }
        }
        var page = $('#demoajax').find('.nextpage').val();
        var isload = $('#demoajax').find('.isload').val();

        if ((($(window).scrollTop() + document.body.clientHeight) == $(window).height()) &amp;&amp; isload == 'true') {
            $('#loading').show();
            var ajaxreq = $.ajax({
                url: "scroll.php",
                type: "POST",
                data: "actionfunction=showData&amp;page=" + page,
                cache: false,
                success: function (response) {
                    $('#demoajax').find('.nextpage').remove();
                    $('#demoajax').find('.isload').remove();
                    $('#loading').hide();

                    $('#demoajax').append(response);

                }

            });
            ajax_arry[ajax_index++] = ajaxreq;

        }
        return false;

        if ($(window).scrollTop() == $(window).height()) {
            alert("bottom!");
        }
    });

});
</code></pre>