Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional navigation #266

Open
ghost opened this issue Jul 2, 2015 · 2 comments
Open

Add additional navigation #266

ghost opened this issue Jul 2, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2015

I want to create additional navigation or anchors like back to top aside from the navigation on the right. How can I do this?

Or at least, add another navigation with different smooth scroll script like the one from CSS tricks. I tried putting it in my page but my page doesn't even scroll down.

      <ul class="list">
        <li>
          <a href="#1" data-index="1">1</a>
        </li>
        <li>
          <a href="#2" data-index="2">2</a>
        </li>
       </ul>

js

  $(function() {
    $('a[href*=#]:not([href=#])').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
        var target = $(this.hash);
        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
        if (target.length) {
          $('html,body').animate({
            scrollTop: target.offset().top
          }, 1000);
          return false;
        }
      }
    });
  });
@RoyH84
Copy link

RoyH84 commented Sep 21, 2015

Experiencing the same problem. Anchors seems stop working when plugin enabled.

@ragivort
Copy link

ragivort commented Apr 6, 2017

Do you solve this problem?
Or can you advise another plugin?
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants