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 7050753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:10:57+00:00 2026-05-28T03:10:57+00:00

I am building a website with a fixed place menubar that is 35 px

  • 0

I am building a website with a fixed place menubar that is 35 px high on top of my page. In that menu I have four items that link to sections down the page. When I click on the links the page jumps to that section, but the 35 px menubar covers the top of the text.

How can I modify this site so that when I jump down to a section it doesn’t link me to the exact part of the HTML document, but 35 px higher to take into consideration the static menubar?

I am doing this with href code:

<a href="#links"><li>Links</li></a>
<h1><a name="links">Links</a></h1>

Thanks!

EDIT: Menubar code

<div id="top-floating-bar"> <!-- Menubar -->
<div class="row">
  <div class="column grid_12">
    <div class="fixed-bar-buttons">
      <ul>
        <a href="#top"><li>Home</li></a>
        <a href="#links"><li>Links</li></a>            
        <a href="#resume"><li>Resume</li></a>
        <a href="#social"><li>Social</li></a>
      </ul>
    </div>
  </div>
</div>
</div> <!-- End the Menubar -->
  • 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-05-28T03:10:57+00:00Added an answer on May 28, 2026 at 3:10 am

    Description

    You can use jQuery .offset() and .scrollTop() function

    Update after a discussion with tguidon

    I don’t know how your top-floating-bar css is defined, but i know what you want.
    The size of the menubar in the fiddle is not right, because i dont know your definition.

    Check out the jSFiddle.

    Sample

    Html

    <head>
        <script src="jquery-1.5.1.min.js" type="text/javascript"></script>
        <script type="text/javascript"><
              $(function() {
                $(".goto").click(function() {
                  var target = $(this).attr("href")
                  target = target.substring(1,target.length);
                  $(window).scrollTop($('a[name="'+target+'"]').offset().top - 35); 
                  return false; 
                });
            });
        </script> 
    </head>
    
    <div id="top-floating-bar"> <!-- Menubar -->
    <div class="row">
      <div class="column grid_12">
        <div class="fixed-bar-buttons">
          <ul>
            <a href="#top" class="goto"><li>Home</li></a>
            <a href="#links" class="goto"><li>Links</li></a>  
            <a href="#resume" class="goto"><li>Resume</li></a>
            <a href="#social" class="goto"><li>Social</li></a>
          </ul>
        </div>
      </div>
    </div>
    </div> <!-- End the Menubar -->
    
    <br><br><br><br><br>
    <a name="top"/> Top Section
    <br><br><br><br><br><br><br><br>
    
    <a name="links"/> Links Section
    <br><br><br><br><br><br><br><br>
    
    <a name="resume"/> Resume Section
    <br><br><br><br><br><br><br><br>
    
    <a name="social"/> Social Section
    <br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br>
    

    More Information

    • jQuery.scrollTop()
    • jQuery.offset()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a website www.etutornetwork.com, in top menu I have included a link
So I'm building a website that has a prices page in it that lists
I'm building a website which has a page that users can add content to,
I am building a mobile website that contains fixed elements. Unfortunately the iPhone handles
I'm building a website that fetches text from another page and insert it into
I am building a website to capture data. I have many spreadsheets that are
I have a wordpress website where in post page I have a jquery fixed
Building a website that has English & Japanese speaking users, with the Japanese users
I'm building a website that will require user registration and logon. I would like
I am building a website that is loaded into a frameset by other sites

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.