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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:20:00+00:00 2026-05-28T03:20:00+00:00

Alright, here is my javascript: $().ready(function (){ $(.contact).hover(function (){ … }); $(.contact).not(‘.contact[id=’+activeId+’]’).click(function (){ …

  • 0

Alright, here is my javascript:

$().ready(function (){
$(".contact").hover(function (){
    ...
});
$(".contact").not('.contact[id="'+activeId+'"]').click(function (){
    ...
});
$(".contact_chooser_contact").click(function (){
    ...
    $('.contacts').append('<div class="contact" id="'+id+'" title="'+phone+'">\
                                <div class="contact_img"><img src="src/default_face.png" width="64"/></div>\
                                <div class="contact_info" id="'+name+'">'+name+' <span class="sms_number">0</span></div>\
                                <div class="contact_last_sms">\
                                \
                                <!-- span class="last_sms_time"> echo $message[sizeof($message)-1]->time; </ -->\
                                </div>\
                            </div>');           
    ...
});
});

Notice, how in the “contact_chooser_contact” click handler, I append another “.contact” in “.contacts”, but now when I hover over that new “.contact”, it doesnt do anything like it is supposed to. How can I fix this problem, I understand that its because I havent reinitiated the ‘$(“.contact”).hover()’ after I added the new “.contact”, but is there an easier way?

  • 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-28T03:20:01+00:00Added an answer on May 28, 2026 at 3:20 am

    You need to bind the event with on(), using this will bind any element added to the DOM with the respective selector. The advantage of using on() over live(), is that you can narrow down the context to a specfic container, rather than the entire document. In my example, I just use the document as the context.

    jQuery 1.7 use on()

    $(document).on('mouseover', '.contact', function(){
      ...
    }); 
    

    Less than 1.7, use delegate()

    $(document).delegate('.contact', 'mouseover', function(){
       ...
    }); 
    

    Less than 1.4.2, use live()

    $('.contact').live('mouseover', function(){
       ...
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, here's my current test function: function make_void( str ) { var str_arr =
So I have here a JavaScript stack built after this function: function Stack() //Creating
Alright, here's a demo of the animation (click the word HIPSTERS in the header):
Alright so here is my issue. I'm working a game engine that will eventually
Alright so here is the deal. I am trying to make a application that's
Alright, here goes. I'm making a very basic app, and I want the user
Alright, here is the output I get: arm-none-linux-gnueabi-ld --entry=main -dynamic-linker=/system/bin/linker -rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++
Alright, hard to phrase an exact title for this question, but here goes... I
Alright, I'm having some issues and I believe it's a CSS one. Here is
Alright here is what I am attempting to do. I have a form written

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.