title: start second page where first page end in javascript
body: <p>I have some issue with the window scroll.
  I created a news feed like page using angularjs with database and pagination and ng-repeat.
  I want that when user click on load more button window will scroll to last position of the page 1 and then page 2 start, but I tried all option but it not working like what I want.</p>
  
  <p>But it always send me last of the document.
  Here is the code for reference...</p>
  
  <pre><code>$scope.feedCopy=function(){
      $scope.loader=false;
  
      $http.get('http://web.com/app/get_feeds/1/'+$scope.member_id+'?page='+$scope.feeds_current_page).then(function(response){
          $scope.feeds = $scope.feeds.concat(response.data.data);
          $scope.feeds2=angular.copy($scope.feeds);
          $current_index=$scope.feeds2[0].feed_id;
  
          var i=0;
          $scope.showLess=true;
          $scope.showMore=false;
              for(i;i&lt;$scope.feeds2.length;i++)
              {
                  $scope.feeds2[i].show_less=1;
                  if($scope.feeds[i].feed_text!=null)
                  {
                      $scope.original_length=$scope.feeds2[i].feed_text.length;
  
                      $scope.feeds2[i].feed_text=$scope.feeds[i].feed_text.substring(0,40);
                      $scope.temp_length=$scope.feeds2[i].feed_text.length;
  
  
                      if($scope.temp_length&gt;=$scope.original_length)
                      {
  
                          $scope.feeds2[i].show_less_button=1;
                      }                       
                  }
                  else
                  {
                      $scope.feeds2[i].show_less=-1;
                  }
  
              }
              $scope.feeds_total_page=response.data.total_pages;
              if($scope.feeds_total_page&gt;$scope.feeds_current_page)
              {
                  $scope.feeds_current_page+=1;
                  $scope.load_more=true;
              }
              $scope.feed_condition_current_page++;
  
      });
      $scope.iframeHeight = document.documentElement.scrollHeight;
      window.scrollTo(0,($scope.iframeHeight))
  
      //alert($scope.iframeHeight);
  
  }   
  </code></pre>