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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:20:24+00:00 2026-05-31T17:20:24+00:00

With this javascript I’m printing list of records: <script type=text/javascript> $(document).ready(function(){ function hide(){ $(‘#friend_list’).fadeIn(100);

  • 0

With this javascript I’m printing list of records:

<script type="text/javascript">
    $(document).ready(function(){

        function hide(){
        $('#friend_list').fadeIn(100);
        $('#friend_list').load("friend_list.php");
        };

        setInterval( hide,100 );

    });

</script>

in friend_list.php I’m getting all the records relevant for user and returning it like this:

echo "<div class='friend' id='friend'>" . $a["username"] . "<input type='hidden' value='$id'/>" . "</div>";

And I’m using this simple script to make overlay:

 <script type="text/javascript">
 $(document).ready(function(){
function overlayerOn(){
    $('#overlayer').fadeIn(800);
}

function overlayerOff(){
    $('#overlayer').fadeOut(800);
};

$('#board').click(function(e){e.stopPropagation();});

$('.friend').click(function(e){
    e.preventDefault();
    overlayerOn();
    var $br = $('#board');
    $br.css('display', 'block');
    });

$('#overlayer').click(function(e){
    overlayerOff();});
});
</script>

Overlay is working as long as I trigger it with some other id or class than the one used from friend_list.php. But that is the one I need. Any idea why overlay is not working when triggered by class .friend?
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-31T17:20:25+00:00Added an answer on May 31, 2026 at 5:20 pm

    Use (live is deprecated)

    $('.friend').live('click', function(e){
        // your code
    });
    

    If you are using latest version of jquery then use

    $('body').on('click', 'div.friend' , function(e){
        // your code
    });
    

    It’s happening because you are loading content dynamically using

    $('#friend_list').load("friend_list.php");
    

    so click is not working because those contents were not in the DOM when it was loaded.

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

Sidebar

Related Questions

Consider this JavaScript Code: <script type=text/javascript> function loop(Message){ document.getElementById('output').innerHTML = document.getElementById('output').innerHTML + Message +
I have this javascript method: <script type=text/javascript> function MyFunction(sender, eventArgs) { if (someCondition) {
I have this JavaScript in the head of my page. <script type=text/javascript> var nojscss
How do I get this javascript to run every second? source code: <script type="text/javascript">
Ok so Ive got this Javascript file, simply: $(document).ready(function() { $('.status').prepend(<div class='score_this'>(<a href='#'>score this
This javascript works fine in Chrome and Firefox but not in IE8: <script type=text/javascript>
I have this Javascript data: [{id:123,type:test},{id:154,type:another}] How would you transform that into something so
I came across this JavaScript function and I don't understand quite what it's doing,
I got this javascript code from off the internet. It's a script that changes
is this javascript function (checkValidity) correct? function checkTextBox(textBox) { if (!checkValidity(textBox.getValue())) displayError(Error title, Error

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.