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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:29:48+00:00 2026-06-05T02:29:48+00:00

I am trying to create a menu with jQuery as in when the user

  • 0

I am trying to create a menu with jQuery as in when the user mouseover an element the menu would show up and would hide when user moves the mouse away.

My html code:

<div class="span8 img">
   <img src="http://farm4.staticflickr.com/3198/2978120072_ca00381e08.jpg" alt="" width="550px" height="368px">
   <div class="like-box">Like</div> 
</div>

CSS:

.like-box {
    display: block;
    background: rgba(255, 255, 255, .9);
    padding: 15px;
    position: absolute;
    left: -1px;
    width: 94%;
    bottom: -1px;
    display: none;
}

Javascript:

$('.img').mouseover(function() {
        $(this).parent().siblings('.like-box').css('display', 'block');
        $(this).parent().siblings('.like-box').mouseleave(function() {
        $(this).css('display', 'none');
        })
    });

but this doesn’t seem to work.

  • 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-05T02:29:50+00:00Added an answer on June 5, 2026 at 2:29 am

    Bind the mouseleave event out of img mouseover, because binding event within mouseover, bind the mouseleave event to like-box each time, which is not good and unnecessary.

    $('.like-box').mouseleave(function() {
        $(this).css('display', 'none');
    })
    $('img').mouseover(function() {
        $(this)  // this point to img
          .next('.like-box')  // point to like-box
          .css('display', 'block');       
    });
    

    DEMO

    NOTE:

    • $('.img') should be $('img') because you image has no class called img, . selector is use for access class. read about selectors and also class-selector
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a menu panel in jQuery, all is complete except
I have been trying to create a menu panel with jQuery that can be
I am trying to create pop up menu using Jquery mobile, by clicking the
I am a Jquery noob. I and am trying to create an accordion menu.
I'm trying to create an accordion type menu using the following JQUERY: function initMenu()
All, I am new to JQuery and trying to write JQuery code to create
im using jQuery and im trying to create a menu using a list of
I am trying to create a drop down menu using jQuery and CSS. Here
i am trying to create a menu bar using jquery. I am using the
I'm trying to create a sliding FAQ menu using jQuery, but I'm getting an

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.