I would like to move to any element (id) on my page. I have this code that moves to the top.
$window.scrollTo(0, angular.element(document.getElementById('content')).offsetTop);
This code moves me to the top of the page, only, it goes there "fast". I need to make it move a bit "slower". Also, it only goes to the top. Can I make it go anywhere in my page? This is the complete code where I implement this.
$scope.uploadFiles = function(file, errFiles) {
$scope.f = file;
$scope.errFile = errFiles && errFiles[0];
if (file) {
file.upload = Upload.upload({
url: '/Account/ReceiveUpload',
data: { file: file }
});
}
file.upload.then(function (response) {
debugger;
$rootScope.avatar = "data:image/png;base64," + response.data.avatar;
$window.scrollTo(0, angular.element(document.getElementById('content')).offsetTop);
})
};