html - Not scrolling to bottom of the page on adding new element -


on adding new element on last child of `container' on time scroll appears. i'd scroll-down put new element on browser view.

i tried using '$anchorscroll` doesn't work.

html

<div class="gallerymenu">         <!-- <a class="live" ng-click="gallerymenu('live')" href="#">live</a>         <a class="visual" ng-click="gallerymenu('visual')" href="#">visuals</a> -->         <a class="projects" ng-click="gallerymenu('projects')" href="#">projects</a> //clicking , calling gallerymenu function </div> <!-- focus needs applied here, height of element 180px --> <div class="appgallery" ng-show="galleryshow" id="anchor3">         <a ng-click="gallerychanger('prev')" class="prev" href="#">prev</a>         <a ng-click="gallerychanger('next')" class="next"  href="#">next</a> </div> 

js

"use strict";  angular.module("tcpapp")     .run(['$anchorscroll', function($anchorscroll) {         $anchorscroll.yoffset = 180; //running here.     }])     .controller("homecontroller", ['$scope','server', '$anchorscroll', '$location', function ($scope, server, $anchorscroll, $location) {          $scope.gallerymenu = function (gallery) {          var newhash = 'anchor3';         if ($location.hash() !== newhash) {           $location.hash('anchor3');         } else {           $anchorscroll();         }      }]); 


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -