angularjs - is it possible to have a full url route to a anchored element on the same page? -


I have html5mode (true) set in my code and all my contents are in the same See.

Users will have to click About this and scroll over the #about element, it works very well with jquery because you can easily You can animate the scrolling and make it good and fluid.

However, I am struggling to see how I can use these routes, and even without reloading that jquery slide interaction, the template / view defined in my routes.

Ideally, I like URLs like example.com/about , example.com/contact and just behind those scenes, scroll them over that element

Any help?

Edit: Here I have tried so far and it does some work without animation ..

In my navigation controller I have the following ..

  $ scope.scrollTo = $ root scope. $ ('$ LocationChangeStart', function (e, n, c) {e.preventDefault (); $ location.hash ('about'); $ anchor scroll ();});   

However, it works only when a user clicks the button on the page, and does not eat the URL at all.

Does this mean you?

(not my code)

Anchor is included in the URL,

& lt; A href = "# test? ScrollTo = foo" & gt; Test / Foo & lt; / A & gt; & Lt; A href = "# weee? ScrollTo = bar" & gt; V / bar & lt; / A & gt;

and the run function hash moves on the module. ($ $ root scope, $ location, $ anchor scroll, $ route param) {$ Root Scope. $ ('$ RouteChangeSuccess', function (new route, old route) {$ location.hash ($ routeParams .scrollTo); $ anchorScroll ();})}}

Hope That it helps you ..

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -