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

  • Home
  • SEARCH
  • 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 8871239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:56:28+00:00 2026-06-14T17:56:28+00:00

I was making navigation menu for my website that works like this: there is

  • 0

I was making navigation menu for my website that works like this: there is navigation, arrow and main content. when you load page, arrow points to home option in navigation, and when you hover over other options, it moves to currently hovered option, and when mouse leaves navigation, it comes back to home option.

I managed to do it on homepage, but now i have a problem with other 6 pages. I don’t know how to make arrow always go back to navigation option that has a href=”#”, instead of always going back to homepage option.
navigation is vertical.

here is my code:

$(document).ready(function() {

$('#arrow').css({'marginTop' : top});

$('ul li h3').hover(function(){

     var top = $(this).parent().position().top; //getting margin-top value of hovered element


$('#arrow').stop().animate({
    'marginTop' : top-115 //setting margin top,and removing 115px for aesthetics 

    });
},function(){
    $('#arrow').stop().animate({
    'marginTop' : 10 //here i set margin-top to 10 because that is where home option is
    })
});
});

I know that i can solve this by making .js file for each page with different values for default margin-top, but that way i wont learn anything new, and I am making this website to practice.

Thanks in advance,
Dobrica

  • 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-14T17:56:29+00:00Added an answer on June 14, 2026 at 5:56 pm

    Didn’t test it but it might be something very close if not working.

    declare var top at the beginning of $(document).ready();

    var top = $('ul li h3 a[href=#]').position().top;
    

    and run the script you are using to animate the arrow to that position.

    Basically you are selecting the anchor with the “#” in the href value, you get its top and set it as initial top value

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

Sidebar

Related Questions

I'm making a web application that uses hash tags for page navigation like this
I'm making a navigation menu for my website. I wanted it to look like
I am making a one-page website for a client. There are 3 different menu
I am currently making a website that includes a menu navigation almost identical to
I am currently making a website that includes a menu navigation almost identical to
I am making a tabbed navigation menu via jQuery in my website. All the
I'm making a navigation bar that remains at the top of the page. When
Im making a 3 page mobile optimised website. I need horizontal slide navigation as
I'm making a navigation bar like Twitter, but I want that one div inside
I am making a website's top navigation. There is a margin bug with the

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.