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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:19:15+00:00 2026-05-25T10:19:15+00:00

I have a tag that appears on an image when the mouse enters the

  • 0

I have a tag that appears on an image when the mouse enters the image. When I want to go on the link with the mouse the link logically disappears because i used .mouseleave() function to hide the link when the mouse leaves the image.

I thought to do a conditional test for the .mouseleave() as follow:

if(!$("#linkId").mouseenter()){
//...
}

I tried with .not().mousenter() instead of ! not

But it does not work.. When I enter on the link, it stays and it it never leaves…

Thank you

Sam

  • 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-25T10:19:16+00:00Added an answer on May 25, 2026 at 10:19 am

    Put both, the link and the image in a container and assign the event handler to the container instead. You can position the link with CSS.

    As the link and the image are children of the parent, the mouseleave event is not triggered when you hover over the link.

    Example:

    HTML:

    <div id="parent">
        <div id="image"></div> <!-- the div is just an example -->
        <a id="link" href="#">Some link</a>
    </div>
    

    CSS:

    #parent {
        position: relative;
    }
    
    /* used div for demo only */
    #image {
        width: 100px;
        height: 100px;
        border: 1px solid black;
    }
    
    #link {
        position: absolute;
        top: 0;
        left: 0;
        display: none;
    }
    

    JavaScript:

    $('#parent').hover(function() {
        $('#link').toggle();
    });
    

    DEMO


    $("#linkId").mouseenter() is not doing what you think it does. It does not test whether the mouse is over the link or not, it generates a mouseenter event on the link.

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

Sidebar

Related Questions

I have a user profile image in my website and I want to tag
I have XML tag that has the content which is HTML document. <xml-tag> <!--
I have a problem with accented letters. For example: I have a tag that
Well i have a div tag that i show as a modal dialog this
In my HTML code, I have a form tag that contains two input boxes,
I have created a custom tag that looks like this: def textField = {
I have data-segment attribute in my body tag that is changed by a slider.
I have text within a paragraph tag that that fits snug on the bottom
So I have a weird problem. I have an <a/> tag that I am
I have a center background image on my body tag. When my site is

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.