AngularJs Scroll to Bottom
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope,$location, $anchorScroll) { $scope.scrollToBottom = function() { // set id of element you want to scroll $location.hash('body'); $anchorScroll(); }; }); </script> </head> <body id="body"> <div ng-app="myApp"> <div ng-controller="myController" > <input type="button" value="Scroll to Bottom" ng-click="scrollToBottom()"> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope,$location, $anchorScroll) { $scope.scrollToBottom = function() { // set id of element you want to scroll $location.hash('body'); $anchorScroll(); }; }); </script> </head> <body id="body"> <div ng-app="myApp"> <div ng-controller="myController" > <input type="button" value="Scroll to Bottom" ng-click="scrollToBottom()"> </div> </body> </html>
Copyrights@tutorialsplane.com