http://blog.csdn.net/M_killer/article/details/50394254
angular.module('myApp', ['ngRoute'])
.run(['$anchorScroll', function($anchorScroll) {
$anchorScroll.yOffset = 50;
// 默认向下便宜50px
// 在此处配置偏移量
}])
.controller('View1Ctrl', ['$scope', '$location', '$anchorScroll', function ($scope, $location, $anchorScroll) {
$scope.demo = function () {
$location.hash('test');
$anchorScroll();
//移动到锚点
};
}]);
angular.module('myApp', ['ngRoute'])
.run(['$anchorScroll', function($anchorScroll) {
$anchorScroll.yOffset = 50;
// 默认向下便宜50px
// 在此处配置偏移量
}])
.controller('View1Ctrl', ['$scope', '$location', '$anchorScroll', function ($scope, $location, $anchorScroll) {
$scope.demo = function () {
$location.hash('test');
$anchorScroll();
//移动到锚点
};
}]);