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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:06:11+00:00 2026-05-20T03:06:11+00:00

Sorry if this is a silly question but I have been on web design

  • 0

Sorry if this is a silly question but I have been on web design for 2 weeks and I am trying to make some menu tabs. Specificity ones that protrude when you mouseover and recede back to start position when mouseleave. I have made some code but it seems to act strangely.
When I mouse over its fine and the tab comes down 10px but when I leave the second time on any tab it recedes 10px then another 10px and it adds up each time incrementally, 20, 30, 40 etc.

I have tried popping in a stop even propergation but I am still learning. If its messy let me know.

Here is the code.

$(document).ready(function(){
 $('.buttons').mouseover(function(){
  $(this).animate({top: '+=10'}, 200, function() {
   $(this).mouseleave(function(){
    $(this).animate({top: '+=-10'}, 200, function() {

    });
   });
  });
 });
});
  • 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-20T03:06:11+00:00Added an answer on May 20, 2026 at 3:06 am

    Take a look at http://jsfiddle.net/thewebdes/DqfJ5/

    Is that what you were after?

    HTML

    <ul>
        <li><a href="#" class="buttons">Link 1</a></li>
        <li><a href="#" class="buttons">Link 2</a></li>
        <li><a href="#" class="buttons">Link 3</a></li>
    </ul>
    

    CSS

    body { font-family: arial, helvetica, sans-serif; }
    li { float: left; display: inline; margin: 0 1px 0 0; }
    a:link, a:visited { position: relative; display: block; padding: 5px 10px; text-decoration: none; color: #39F; background: #039; border: 1px solid #03C; }
    a:hover, a:active { color: #F90; background: #960; border: 1px solid #630; }
    

    JS

    $('.buttons').hover(function() {
        $(this).stop(true,true).animate({top: '-=10', paddingBottom: '15px'}, 200);
    }, function() {
        $(this).stop(true,true).animate({top: '+=10', paddingBottom: '5px'}, 200);
    });
    

    — edit to answer comment —

    If you don’t want the text to move:

    $('.buttons').hover(function() {
        $(this).stop(true,true).animate({paddingBottom: '15px'}, 200);
    }, function() {
        $(this).stop(true,true).animate({paddingBottom: '5px'}, 200);
    });
    

    If you do:

    $('.buttons').hover(function() {
        $(this).stop(true,true).animate({paddingTop: '15px'}, 200);
    }, function() {
        $(this).stop(true,true).animate({paddingTop: '5px'}, 200);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sorry if this is a silly question but I have been working
Sorry if this is a silly question or if it's been answered already, but
Sorry, this question might sound silly, but I need some help! My project is
I am really sorry to ask this silly question. I have been onto this
Sorry if this is a silly question. But I've been struggling with this for
Sorry for this silly question, but is there any way to restrict using directives
Sorry if this question sounds a little silly, but I am not sure what
Sorry for such a trivial question, but I'd feel silly building this if it
Sorry about this silly question. I'm trying to learn objc and I'm unable to
Sorry if this is a silly and/or stupid question but... Will there ever be,

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.