named anchor not working

Melody Scott
Melody Scott used Ask the Experts™

Hi- I took this through the validator and made the suggested changes, but it broke the look of the page, so I took it back. There are only a few errors.

At the top, the four words:

    HomeStyle Menu
    MK Meals Special Diet Menu
    Health News
Are linked to <section id="sec1">  etc.

For instance, I have: <li role="presentation"><a href="#sec5">Health News</a></li> and <section id="sec5">.

What's wrong? Thanks.

But they aren't linking.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2016
See near line 630...
// Adds active state to secion navigation
$('.nav li').click(function(e) {
  $('.nav li').removeClass('active');

Open in new window

e.preventDefault() tells the browser to ignore the standard actions associated with these DOM elements.  Try removing that line and see if it helps.


That was it, thanks!! I am taking a javascript course this week, I hope to bother you guys less!
Most Valuable Expert 2011
Top Expert 2016


"Bother us" any time -- we're glad to help :-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial