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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:52:56+00:00 2026-05-24T21:52:56+00:00

I want do hover in a div, append a new div in body part,

  • 0

I want do hover in a div, append a new div in body part, some code here.

but my problem is: now it is not append a new div but replace the first all html. Where is the problem? Thanks. http://jsfiddle.net/U7QqB/3/

JS

jQuery(document).ready(function() {
  $('.click').hover(function(){
    var html = $(this).find('.text').html();   
    $('body').append('<div id="object"/>').html(html).css({'top':'200px','left':'300px','z-index':'10'});
  });
});

css

.click{position:realavite;top:100px;left:300px;}
.text{display:none;}
.object{position:absolute;}

html

<body>
<h1>A hover append div text</h1>
<div class="click">
    <img src="http://nt3.ggpht.com/news/tbn/U7Q-7enFr00rUM/1.jpg" />
    <div class="text">text</div>
</div>
</body>
  • 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-24T21:52:57+00:00Added an answer on May 24, 2026 at 9:52 pm

    That’s because append() returns the original jQuery object (the one containing the <body> element), not a new one containing the appended content.

    You can use appendTo() instead:

    $('<div id="object">').appendTo('body').html(html).css({
        'top': '200px',
        'left': '300px',
        'z-index': '10'
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DIV where some code is presented. When I hover on this
I have this code: $('a[rel=imagesHandler]').hover( function(){ //ia latimea var liWidth = $(this).width(); $(this).append('<div id=editBar><a
I want a solution for tag:hover that is not working on ie6. My guess
I want to change the link-style for some of my links, like this: a:hover
I want to hover the image in static FBML page. But even the following
Below I have some code which basically animates a div from the bottom of
I want to make a hover effect on a image. That works fine! But
Here is the problem : I want to create reactive zones on a image
I want to change the css attribute of a div on hover like $(function(){
Here is the page i am working with: http://jimeagle.com/new/music/ I want to make it

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.