Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8817615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:53:33+00:00 2026-06-14T04:53:33+00:00

http://jsbin.com/ifutav/2/edit I want to use http://balupton.github.com/jquery-scrollto/demo/ to automatically scroll relative navigation links. With the

  • 0

http://jsbin.com/ifutav/2/edit

I want to use http://balupton.github.com/jquery-scrollto/demo/ to automatically scroll relative navigation links. With the code below this is the error I’m getting: Uncaught Error: Syntax error, unrecognized expression: #/article/ which is obviously caused by the slashes (which are a required namespace from a ajax plugin), when I remove them the error goes away but still does not work: http: //jsbin.com/ifutav/3/edit but the e.preventDefault() does. So obviously two errors are happening here:

  1. jQuery doesn’t like the href value
  2. scrollTo isn’t working correctly

HTML: links

<nav id="nav">
  <ul>
    <li><a href="#/item-1/">Item 1</a></li>
    <li><a href="#/item-2/">Item 2</a></li>
    <li><a href="#/item-3/">Item 3</a></li>
    <li><a href="#/item-4/">Item 4</a></li>
  </ul>
</nav>

HTML: elements

<section id="/item-1/"></section>
<section id="/item-2/"></section>
<section id="/item-3/"></section>
<section id="/item-4/"></section>

Javascript

$('nav ul li a[href^="#"]').each(function() {

  // store values so it doesn't have to execute onclick
  var $this = $(this),
      value = $this.attr('href'),
      element = $(value);

  $this.click(function(e) {

    // prevent default scrolling
    e.preventDefault();

    // scrollTo element
    element.scrollTo();
  });
});

I don’t know the reason behind either of these areas but I assume they are some kind of type error? idk…

Thanks ahead of time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:53:34+00:00Added an answer on June 14, 2026 at 4:53 am

    Two things: 1) Remove the forward slashes from your href and id’s. 2) If you are using http://balupton.github.com/jquery-scrollto/demo/ then the method ScrollTo needs a capital S: element.ScrollTo();

    See working example: http://jsfiddle.net/dBh3W/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Jquery UI toggle panel mentioned here: http://jsbin.com/eqape I want to use
Play with it here: http://jsbin.com/ocicu4/4/edit Simple Accordion, I only want one section open at
http://jsbin.com/emoba5/3/edit click here to view demo Does anybody know how to make the image
http://jsbin.com/uremuc/2/edit If I'm choosing jquery 1.5.2 in jsBin , running .attr('tagName') should return me
http://jsbin.com/uluwum/3/edit I have a select list of US states where I only want the
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
http://jsbin.com/ifabem/2/edit use strict; window.x = Hello World; alert(x); // this does't throw an exception
http://jsbin.com/utusiz/6/edit I want to select the last line in the grid without the pager
See: http://jsbin.com/ebudec/edit#javascript,html It seems strange but I think jsBin doesn't recognize the jQuery document
I made some sample of jQuery Dragging http://jsbin.com/ehuke4/6/edit Its all ok when i drag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.