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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:35:06+00:00 2026-06-17T13:35:06+00:00

I have a page with several images on it. When the user hovers over

  • 0

I have a page with several images on it. When the user hovers over any one of the images, I would like a 50% opaque overlay div to fade in with information about the image being hovered over. Here is the code I have in the PHP just now (I’ve removed the string concats etc for easier reading):

<div class="propertyoverlay"
    id="boxnum'.$propertynumber.'"
    onMouseOver="fadein(\'boxnum'.$propertynumber.'\')"
    onMouseOut="fadeout(\'boxnum'.$propertynumber.'\')"
>';
    <h3 class="price">'.$properties[$propertynumber]['price'].'</h3>';
</div>';

Which feeds the div ID over to the following commands:

function fadein(id){        
    $('#'+id).animate({ 'opacity': 0.5 });
}

function fadeout(id){        
    $('#'+id).animate({ 'opacity': 0 });
}

The issues I’m having are:
A. if a user hovers on and off from the image repeatedly and quickly, the fade commands stack up. It would be nicer if the mouseOver and mouseOut commands just overwrote the rest of the cue as soon as they were called.
B. When I hover over the H3 tag nested inside the parent, the mouseOut is called directly followed by the mouse over command, causing the div to fade out and then fade in again straight away.

I’m happy to use Javascript or JQuery to solve this, but, if at all possible, would rather avoid a CSS3 based solution for the time being. Thanks very much for your time!

  • 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-17T13:35:07+00:00Added an answer on June 17, 2026 at 1:35 pm

    A: Use the jQuery .stop() method before calling animate, eg:

    $('#'+id).stop(true).animate({ 'opacity': 0 });
    

    B: Try using the mouseenter and mouseleave events in jQuery (docs). This will fix the issue with child elements triggering mouseover/mouseout. This means you will have to bind the events with jQuery however, not directly on the HTML elements.

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

Sidebar

Related Questions

I have a page showing several thumbnail images. When the user mouseovers these images,
I have a page of several videos. One can click a thumbnail to play
I have a page that contains several forms, by submitting each one of them,
i have a page that contains several submit buttons however i only want one
I have a page with an HTML5 canvas, on which several images are displayed.There
I have created a simple webpage with several images, but when a user visits
I have a page that needs to load several dynamically generated images. Everything works
Each UITableViewCell contains several labels and images (just like the home page for a
Hi all, do we have page flip/turn animation in android? I have several images,
So I've made a gallery web page that supports uploading several images in one

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.