javascript - Angularjs - auto-scroll to location -


i'm using ui-router angularjs , know how make screen scroll down (hopefully easing make better) specific part of homepage when user clicks on link. scroll when clicks on link page too.

the examples can find on here scrolling automatically ui-view not want. other examples include ng-route not i'm using.

is there feature built in angular/ui-router or should use have of sites doesn't use angular:

$('a[href^="#"]').on('click',function (e) {   e.preventdefault();    var target = this.hash,   $target = $(target);    $('html, body').stop().animate({     'scrolltop': $target.offset().top   }, 900, 'swing', function () {     window.location.hash = target;   }); }); 

any advice/code appreciated.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -