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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:37:08+00:00 2026-06-07T21:37:08+00:00

I have a task here that requires heavy DOM manipulation. Because this can have

  • 0

I have a task here that requires heavy DOM manipulation. Because this can have a bad impact on the performance, I clone the element, make the changes there and replace the clone with the original.

After replacement, the elements have a hover function.

Because I want faded transition, I do the change like this:

myElement.fadeOut(500, function(){
    myClone.hide();
    myElement.replaceWith(myClone);
    myClone.fadeIn(500);
 });

This is working, but after that the hover functionality does not work anymore. When I remove the callback from fadeOut, I can hover again but the timed transitions does not look good anymore.

What can I do about it? Why do the elements lose their hover-functionality when using the callback?

  • 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-07T21:37:09+00:00Added an answer on June 7, 2026 at 9:37 pm

    i have a different solution for you. CSS approach:

    You can set one of your element’s position;

    #myElement { top:100px; left:200px; }
    #myElement, #myClone { position:absolute; }
    

    jQuery:

    $(document).ready(function() {
    
    var myElement = $('#myElement');
    var myClone = $('#myClone');
    
    var myEleTop = parseInt(myElement.css('top'));
    var myEleLeft = parseInt(myElement.css('left'));
    
    myClone.hide();
    myClone.css({'top':myEleTop+'px','left':myEleLeft+'px'});//sets position here
    
    myElement.mouseenter(function() {
        myElement.fadeOut(500, function(){
          myClone.fadeIn(500);
        }
    });
    myElement.mouseleave(function() {
        myClone.fadeOut(500, function(){
          myElement.fadeIn(500);
        }
    });
    
    });
    

    or you can just use appendTo() and remove() methods, i am not really experienced with these methods but try this:

    myElement.mouseenter(function() {
        myElement.fadeOut(500, function(){
          myElement.remove();
          myClone.appendTo($('.container'));
          myClone.fadeIn(500);
        }
    });
    myElement.mouseleave(function() {
        myClone.fadeOut(500, function(){
          myClone.remove();
          myElement.appendTo($('.container'));
          myElement.fadeIn(500);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, here's the situation: I have a parent buildfile that defines a compilation task,
There are numerous discussions here that have addressed issues that seem related to this
Hi and thanks for looking! Background I have a computing task that requires either
Here's a problem. Developers have some kind of a task (develop certain feature), which
I have task involving reading SAS .xpt files using .NET. For that I'm using
I am new this sharepoint development and i have task in hand to do
I have some task regarding do operations on database using ADODB in Vb.NET. Can
I have a task to do, I need to take data that has been
I have a task that runs periodically 10 second. I do some picturebox refreshing
I have a Classic ASP site, that requires some database tables to be emptied

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.