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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:39:37+00:00 2026-06-03T18:39:37+00:00

I have the following HTML <ul> <li class=operation>Lorem … <span rel=popover data-content=Impsum>%</span></li> <li class=operation>Lorem

  • 0

I have the following HTML

<ul>
<li class="operation>Lorem ... <span rel="popover" data-content="Impsum">%</span></li>
<li class="operation>Lorem ... <span rel="popover" data-content="Impsum">%</span></li>
<li class="operation>Lorem ... <span rel="popover" data-content="Impsum">%</span></li>

I’d like to fadeIn the span element when the mouse goes over the list item and fadeOut when the mouse moves away from the item. BUT IF the mouse goes over the span itself I’d like to keep it visible even after the mouse moves away. I mede several attempts but every time the span disappears when the mouse is not over anymore. Below you may find the last 2 attempts

$(".operation").on("mouseenter", function(event){
$(this).children("span[rel=popover]").fadeIn(200);
}).on("mouseleave", function(event){
  $(this).children("span[rel=popover]").fadeOut(200);
});

$("span[rel=popover]").off("mouseleave", function(event){
    $(this).fadeOut(200);
});

and

$(".operation").on("mouseenter", function(event){
 $(this).children("span[rel=popover]").fadeIn(200);
}).on("mouseleave", function(event){
  $(this).children("span[rel=popover]").fadeOut(200);
});

$("span[rel=popover]").hover(function(){
  $(this).off("mouseleave", function(event){
    $(this).fadeOut(200);
  });
});

Am I missing something? How can I fix it ?

Thanks and have a nice day.

  • 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-03T18:39:40+00:00Added an answer on June 3, 2026 at 6:39 pm

    I would do something like this:

    $('.operation').hover(function () {
        var i = $(this).index();
        $('span').eq(i).stop(true).animate({'opacity' : 1}, 200);
    }, function () {
        $('span').animate({'opacity' : 0}, 200);    
    });
    
    $('span').hover(function () {
        $(this).animate({'opacity' : 1}, 200);
    }, function () {
        return false;
    });
    

    I tend not to use the fadeIn and fadeOut methods for hover events because jQuery has a funny little bug that gradually (and irreversibly) diminishes the opacity of an element if the user moves the cursor over it several times in rapid succession.

    You can include a stop method to end any current animations. Passing an argument of true clears the animation queue.

    You can see my working example here: http://jsfiddle.net/xKy49/2/

    The spans can’t be child elements of the list items if they’re to behave differently on hover.

    Also, don’t forget to close your class declarations! There should be a double quote after
    operation
    :

    <li class="operation">Lorem ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have some html that looks like the following: <div class='something unknown' id='something_unknown_1'>
I have the following HTML: <div id=mydiv> </div> I would like to load content
I have the following HTML: <tr> <td class=ui-widget-content> <a title=Edit href=/Administration/Menus/Edit/001W class=editLink ui-button ui-widget
I have the following html code: <div class=result hide id=userNameTooShort><span class=error>Your username needs to
I have the following HTML (..) <tbody> <tr> <td class=name> Test1 </td> <td class=data>
I have the following HTML code: <div class=container> <span class=red></span> <span class=hot></span> </div> On
I have the following HTML code: <fieldset> <legend><span>Contact Details</span> <span class=edit1>Edit</span><span class=hide1>Hide</span></legend> <div> <!--content-->
I have the following HTML code: <tr id=1774 class=XXX><td> <span class=YYY> Element 1</span></td></tr> <tr
I have the following HTML: <label class=fileinput-button> <span>add file...</span> <input type=file name=file disabled> </label>
I have the following html structure: <div class=divClass> <a class=aClass href=#> <img src=xxxx.jpg <span

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.