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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:25:40+00:00 2026-05-14T08:25:40+00:00

I would expect something like this to be pretty popular in demand but I

  • 0

I would expect something like this to be pretty popular in demand but I had much trouble finding a suiting script.

I’ve got a basic menu build like this:

<div id="menu">
    <ul>
        <li><a href="#"><img src="images/btn1.png"></a></li>
        <li><a href="#"><img src="images/btn2.png"></a></li>
        <li><a href="#"><img src="images/btn3.png"></a></li>
    </ul>
</div>

The div #menu has a background image of a small arrow. I want the arrow to move vertically in front of the corresponding menu image when you mouseover/mousemove the whole #menu div.

Also when one of the menu images has been clicked the arrow should stay in it’s position in front of the corresponding menu image.

I started something but I notice it’s going downwards, since it’s only working when you’re at the top of the page. What I have is this:

$('#menu').css({backgroundPosition: '5px 10px'}); //Starting position

$('#menu').mousemove(function(e){
    $('#menu').stop().animate(
        {backgroundPosition: '5px ' + (e.pageY-60) + ' px'},
        {duration:100}
    )
}).mouseout(function(){
    $('#menu').stop().animate(
        {backgroundPosition: '5px 10px'},
        {duration:100}
    )
});

Please help!

ps. I’m using this plugin to move background images smoothly.

  • 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-14T08:25:41+00:00Added an answer on May 14, 2026 at 8:25 am

    After some math I managed to work it out. Later on I found someone who managed to do it even faster:

    function rPosition(elementID, mouseX, mouseY) {
      var offset = $('#'+elementID).offset();
      var x = mouseX - offset.left;
      var y = mouseY - offset.top;
    
      return {'x': x, 'y': y};
    }
    

    Source

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

Sidebar

Related Questions

For example, if I make a query like between(1,4,X)? I would expect something like
I would expect the following code snippet to complain about trying to assign something
I would expect the following code to throw a ParseException, but it is 2
In the code below I would expect t2: [{value:.....}, {}, {}] but instead I
I want to do something like: .Helper.ps1 But I have no helper file. I
This is a very broad question, so I expect a pretty broad answer. I
I've seen some similar posts, but nothing quite like this... I have a website
I'm pretty sure this is 100% safe, but I don't want to miss anything.
I have something like this code: for (var i = 0; i < interactions.length;
I would expect a Dictionary object of the form: var dict = new Dictionary<string,string>()

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.