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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:37:16+00:00 2026-06-04T11:37:16+00:00

This question seems somewhat related to How do I check if the mouse is

  • 0

This question seems somewhat related to

  • How do I check if the mouse is over an element in jQuery?
  • jQuery check hover status before start trigger

but still not quite. Here’s the thing: I’m writing a small gallery and at some point the user clicks on a thumbnail. The large version of the image shows as an inside of a full-screen . So far, so good. When the mouse hovers over that I show three images: close, left, right, intended to navigate through an album; when the mouse leaves the image or the navigation images, the three navigation images fade.

These three navigation images partially overlap with the main image, e.g. the close image is a circle in the upper left corner. And that’s the tricky part.

The mouseleave triggers whenever the mouse moves from the main image off the side, or from the main image onto one of the three small overlapping images. The mouseenter triggers for each of the small overlapping images as expected.

However, this creates a funky blinking effect because on mouseleave of the main image I hide() the three small images, which immediately triggers a mouseenter for the main image because of the overlap and the mouse still being on top of the main image.

To avoid that, I tried to determine if, upon mouseleave of the main image, the mouse has moved onto one of the small overlapping images. For that, I used this code:

main_img.mouseleave(function() {
  if (!hoverButtons()) {
    doHideButtons();
  }
});

function hoverButtons() {
  return (close_img.is(":hover")) || (left_img.is(":hover")) || (right_img.is(":hover"));
}

This works great on Safari and Chrome, but not on FF and IE where the images still blink. Further noodling around posts, it seems that “:hover” is the problem here as it is not a proper selector expression but rather a CSS pseudo class?

I tried to work with switches that I flip on/off as I mouseenter/mouseleave the various images, but that doesn’t work either because the events seem to trigger in different orders.

How do I go about this? Thanks!

EDIT: I might have to clarify: before the navigation buttons are shown, I set their respective left and top attributes in order to place them in dependence of the main image’s position. That means I need to do some work before I can call .show() on a jQuery selector. I tried to add a new function .placeShow() but that didn’t quite work with respect to selectors like $(“.nav-button:hidden”).placeShow().

  • 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-04T11:37:17+00:00Added an answer on June 4, 2026 at 11:37 am

    You can try with this:

    $("#main, #small").mouseenter(function() {
        $("#small:hidden").show();
    }).mouseleave(function(e) {
        if(e.target.id != 'main' || e.target.id != 'small') {
          $('#small').hide();
        }
    });
    

    DEMO

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

Sidebar

Related Questions

This question seems to be asked freqeuently over the internet but I still can't
Sorry if this question seems a bit complex but I think its all related
I am new to jquery so please excuse me if this question seems silly...
This question seems like it might be somewhat common, but I didn't find anything
This is somewhat related to my previous question but I've realised that I needed
This is somewhat related to this question . Let's say I have a package
Somewhat related to this question . Outline and border are pretty similar (although they
So this question is (somewhat distantly) related to this previous question: Best way to
This is somewhat related to another question I asked: Translate GPS coordinates to location
This is somewhat of a followup to related question I found here . In

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.