Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Routing to an anchor on a different route

$
0
0

@imdanwalton wrote:

Hi! I'm relatively new to ember, and am struggling to figure out a way to create a link-to that will route to 'index' then scroll to a particular anchor.

When users click on the feature's on any page, I'd them to be routed to 'index' then have the page scroll to the "features" anchor.

I'm currently using ember-scroll-to-mk2. Upon clicking the link on the 'index' page, it works perfectly. But clicking the link on any route other than 'index' the link doesn't work.

Any suggestions would be greatly appreciated.

<nav class="navbar navbar-light bg-faded bg-dark">
    <ul class="nav navbar-nav navbar-right">
      <li class="nav-item">
        {{#link-to 'index' class="nav-link"}}Home{{/link-to}}
      </li>
      <li class="nav-item">
          {{#scroll-to target = "#features"}}Features{{/scroll-to}}
      </li>
      <li class="nav-item">
        {{#link-to 'about.technology' class="nav-link"}}Technology{{/link-to}}
      </li>
      <li class="nav-item">
        {{#link-to 'about.our-story' class="nav-link"}}About{{/link-to}}
      </li>
    </ul>
  </nav>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles