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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:48:46+00:00 2026-06-17T19:48:46+00:00

My problem is that I can’t get the dialog div and all the other

  • 0

My problem is that I can’t get the dialog div and all the other divs inside of it to display the dynamic variables according to the image selected.

I want to be able to dynamically display a table of user pics and when their picture is clicked on the div containing the dynamic table fades to black and a popup containing the users picture and other information shows using JQUERY. Everything works but then popup displaying the respective variables of the user clicked on.

Beginning in the $memberdisplaylist inside the td the $firstname and $member_pic display properly according to the array but when the $member_pic is clicked on, the dialog div popup keeps displaying variables from row 1 and does not display the variables in respect to the row of which $member_pic is selected. Any thoughts on what I am doing wrong and how to fix this?

Also does anyone know the jQuery coding I would need to center my dialog div popup inside my profilepicsdark div containing my dynamic table?

PHP

$MemberDisplayList = "<table border='0' align='left' cellpadding='7'>";
$sql = mysql_query("SELECT * FROM users WHERE email_activated='1'");
$counter = 0;
while($row = mysql_fetch_array($sql)){
    $id = $row["id"];
    $firstname = $row["first_name"];
    $sex = $row["sex"];
    $age = $row["age"];
    $focus = $row["focus"];
    $lastlog = $row["last_log_date"];
    $firstnameCut = substr($firstname, 0, 10);
    $check_pic = "members/$id/image01.jpg";
    if (file_exists($check_pic)) {
        $member_pic = "<img src=\"members/$id/image01.jpg\" width=\"100px\" border=\"0\" />";
    } else {
        $member_pic = "<img src=\"members/0/image01.jpg\" width=\"100px\" border=\"0\" />";
    }
    if( $counter % 7 == 0)
    $MemberDisplayList .= '<tr>';
    $counter++;
    $MemberDisplayList .= '<td>';
    $MemberDisplayList .= '<a href="" title="' .    $firstname . '"><font size="-2">' . $firstnameCut . '</font></a><br /><div class="memberpreviewpopup" style=" height:100px; overflow:hidden;">' . $member_pic . '</div><div class="boxes"><div id="dialog" class="window"><div id="title">' . $member_pic . '</div><div id="info">' . $firstname . '</div><div id="info">' . $lastlogdate . '</div><div id="info">' . $sex . '</div><div id="info">' . $age . '</div><div id="info">' . $focus . '</div><a href="" class="close"/>Close it</a><a href="profile.php?id=' . $id . '">View Profile</a></div></div></td>';
    if( $counter % 7 == 0) 
        $MemberDisplayList .= '</tr>';

} // close while loop

$MemberDisplayList .= "</table>";

JQUERY

<script type="text/javascript">
            function codeBinsAddEvent(obj,type,fn){
                if(obj.attachEvent){
                        if(type == "load"){
                            obj.attachEvent('on'+type, fn);
                        }
                        else{
                            obj.attachEvent('onreadystatechange', fn);
                        }
                        /*
                    obj['e'+type+fn]=fn;
                    obj[type+fn]=function(){
                        obj['e'+type+fn](window.event)}
                    ;obj.attachEvent('on'+type,obj[type+fn])*/
                 }
                else obj.addEventListener(type,fn,false)
            };
            function codeBinsAddLoadEvent(fn){
                codeBinsAddEvent(document.addEventListener&&!window.addEventListener?document:window,'load',fn)
            };
            function codeBinsAddReadyEvent(fn){
                codeBinsAddEvent(document,'DOMContentLoaded',fn)
            };

</script>   

<script type="text/javascript">
  $(function() {
    $(".memberpreviewpopup").click(function(e) {
        e.preventDefault();
        var $dialog = $("#dialog");
        var maskHeight = $('.profilepics').height();
        var maskWidth = $('.profilepics').width();
        $('#profilepicsdark').css({
            'width': maskWidth,
            'height': maskHeight
        });
        $('#profilepicsdark').fadeIn(100);
        $('#profilepicsdark').fadeTo("fast", 0.8);
        var winH = $('.profilepics').height();
        var winW = $('.profilepics').width();
        $('#profilepicsdark').css('top', winH / 2 - $dialog.height() / 2);
        $('#profilepicsdark').css('left', winW / 2 - $dialog.width() / 2);
        $dialog.fadeIn(400);

    });

    $('.window .close').click(function(e) {
        e.preventDefault();
        $('#profilepicsdark').hide();
        $('.window').hide();
    });
    $('#profilepicsdark').click(function() {
        $(this).hide();
        $('.window').hide();
    });

});
</script>

CSS

<style type="text/css">
#profilepicsdark{
  width: 100%;
  height: 100%;
  z-index:9000;
  background-color:#000;
  opacity:0.5;
  display:none;
}
#dialog{
  position: absolute;
  padding:0px;
  width:250px;
  height:250px;
  background-color:#d4e1ff;
  display:none;
  z-index:99999;
}
#dialog #msg{
  margin-left:20px;
  padding:5px;
  font-size:14px;
}
#dialog #title{
  margin:0px;
  padding:5px;
  float: left;
}
#dialog #info{
  width: 100px; 
  margin-right:20px;
  padding:5px;
  font-size:14px;
  float: right;
  text-align:right;
}
#dialog .close{
  float:right;
  background:#afa1f5;
  bordercolor:1px solid #445cd88;
  border-radius: 1.2em;
  width:100px;
  text-align:center;
  font-size:13px;

}
#dialog .close:hover{
  background:#af55d9;
  bordercolor:1px solid #445cd88;
}
</style>
  • 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-17T19:48:47+00:00Added an answer on June 17, 2026 at 7:48 pm

    I think I have an idea of what you’re trying to accomplish here. What’s happening is that the #dialog div is called without the context of the member you’re viewing a preview of.

    It’s a little messy, but if you make the following adjustments you should be about to call #dialog in context.

    HTML:

    $MemberDisplayList .= '
    <a href="" title="'.$firstname.'"><font size="-2">' . $firstnameCut . '</font></a>
    <br />
    <div class="memberpreviewpopup" member_id="'.$id.'" style=" height:100px; overflow:hidden;">
        '.$member_pic.'
    </div>
    <div class="boxes">
        <div id="dialog" member_id="'.$id.'" class="window">
            <div id="title">' . $member_pic . '</div>
            <div id="info">' . $firstname . '</div>
            <div id="info">' . $lastlogdate . '</div>
            <div id="info">' . $sex . '</div>
            <div id="info">' . $age . '</div>
            <div id="info">' . $focus . '</div>
            <a href="" class="close"/>Close it</a>
            <a href="profile.php?id=' . $id . '">View Profile</a>
        </div>
    </div>
    </td>';
    

    Javascript:

    $(".memberpreviewpopup").click(function(e) {
        e.preventDefault();
        // This has been updated ==============
        var member_id = $(this).attr('member_id');
        var $dialog = $('#dialog[member_id="'+member_id+'"]');
        // ====================================
        $('#profilepicsdark').css({
            'width': maskWidth,
            'height': maskHeight
        });
        $('#profilepicsdark').fadeIn(100);
        $('#profilepicsdark').fadeTo("fast", 0.8);
    
        var winH = $('.profilepics').height();
        var winW = $('.profilepics').width();
    
        // This should fix the alignment issue with the box you mentioned ====
        var profilepicsdark_top = winH / 2 - $dialog.height() / 2;
        var profilepicsdark_left = winW / 2 - $dialog.width() / 2;
        $('#profilepicsdark').css('top', profilepicsdark_top); 
        $('#profilepicsdark').css('left', profilepicsdark_left);
        $dialog.css('top', profilepicsdark_top*2);
        $dialog.css('left', profilepicsdark_left*2);
        // ===================================================================
    
        $dialog.fadeIn(400);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck on an aggregation problem that I can't get to the bottom of.
Simple problem that I can't figure out... How can I print a '%' character
I have this problem that I can ref a button for control it. I
i have a problem that i can't solve ! (sqlite3, but i think it
I have a problem that I can't resolve. Let's say I have this map
I faced a problem that I can not find a way to change the
I'm facing a problem that I can summarize as it follows: I have a
I have a weird problem that i can't figure out a solution for: I've
I have a strange problem that I can't seem to solve. I've quite a
I have a bit of a problem that I can't seem to code my

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.