From 2cbd654b77c5c982ab89328d9572bbdb554e69c0 Mon Sep 17 00:00:00 2001 From: "Nguyen Anh Tuan, Tony" Date: Thu, 29 Jan 2015 08:17:15 +0800 Subject: [PATCH] TN: Make main page scroll down to Vets when clicking on the link --- src/main/webapp/components/header.html | 2 +- src/main/webapp/components/main/MainController.js | 6 ++++++ src/main/webapp/index.html | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/components/header.html b/src/main/webapp/components/header.html index 6bed64522..eda3d8f3a 100644 --- a/src/main/webapp/components/header.html +++ b/src/main/webapp/components/header.html @@ -12,7 +12,7 @@ diff --git a/src/main/webapp/components/main/MainController.js b/src/main/webapp/components/main/MainController.js index 57bcc612b..6251a8913 100644 --- a/src/main/webapp/components/main/MainController.js +++ b/src/main/webapp/components/main/MainController.js @@ -4,6 +4,12 @@ var MainController = function($scope, $rootScope, $sce, $timeout, $location, $scope.$route = $route; $scope.$location = $location; $scope.footerText = '© ' + new Date().getFullYear() + ' Pet Clinic, A Spring Framework Demonstration'; + + $scope.scrollToVet = function(){ + $('html, body').animate({ + scrollTop : $("#veterianarians").offset().top + }, 1000); + } }; var MainControllerDeclaration = [ '$scope', '$rootScope', '$sce', '$timeout','$location', '$route', '$interval', '$cookieStore', '$window', MainController ]; diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index af58edbd6..6b7deb872 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -54,6 +54,10 @@ + + + +