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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:47:37+00:00 2026-05-28T02:47:37+00:00

first some code: I have many elements like that: <section class=item> <div class=caption> </div>

  • 0

first some code:

I have many elements like that:

<section class="item>
     <div class="caption">
     </div>
</section>

the “caption” is hidden, when you go on the “item” the “caption” came in.

I did this before with hover() and worked fine, but now I need to have it live(), because I’m adding some more “item”s with an ajax() call.

What’s happening now is that when “caption” is showed, it takes precedence over item, because it is styled as absolute. Here some other code:

.caption {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 5;
    display: none;
}

I like this style because sometimes my “item” can have any size, and “caption” just follows it. But let’s go on.

Symptoms: when I mouse-enter on my “item” the caption shows, then instantly goes away, then goes in, then goes out. Like mad. I know why, I suppose it’s because my “caption” even if lives into “item” takes precedence, so “item” is no more in mouse-enter event. So “caption” leaves, and “item” fires another mouse-enter. And so on, until the end of time.

Here is my javascript, how can I say to live() to behave like it did before with hover()?

$('.item').live({
    mouseenter : function() {
        $(this)
        .find('.caption')
        .animate({
            opacity: 1,
            height: 'toggle'
            }, 'fast');

    },

    mouseout : function() {
        $(this)
        .find('.caption')
        .animate({
            opacity: 0,
            height: 'toggle'
        }, 'fast');     

    }

})  

thank you!

  • 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-28T02:47:37+00:00Added an answer on May 28, 2026 at 2:47 am

    mouseout should be mouseleave to correctly mimic the $.fn.hover method.

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

Sidebar

Related Questions

I have some code that looks like this: int i = 0; foreach (var
I have some code that allows users to upload file attachments into a varbinary(max)
First let me show some code. class User has_and_belongs_to_many :roles named_scope :employees, { :conditions
i have big decision tree with many Yes/No questions. i need implement some code
First of all I have seen that there are many questions about unrecognized selector
I have been working on a form that presents some specific elements in a
I have some code that I believe to run in O(n), however when I
I'm trying to write some code to remove the first N characters in a
I'm trying to write some code to Hide columns if the first 3 characters
I've written some code for a button action. First I'm creating a button UI

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.