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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:26:12+00:00 2026-05-23T01:26:12+00:00

My problem has to do with PHP, jQuery and CSS. I want to make

  • 0

My problem has to do with PHP, jQuery and CSS.

I want to make a lightbox in a while loop, and then have the lightbox give me info for each of the rows.

There is a problem because it makes lightboxes for each of the rows, and with position:absolute we can see only the last row from the result. I don’t want to see the last but I want the light box to show me info depending on which row I have clicked.

Here is the code:

jQuery:

$(document).ready(function(){
    $('.lightbox').click(function(){
        $('.boxi').css('display','block');
    });
});

PHP:

    $result = $db->query("SELECT * FROM destinations WHERE direction=1;");
    while ($rows = mysql_fetch_array($result)) {
        $name = $rows['name'];
        $table .=  '<div class="destionations">
                <div class="name">Prej: <strong>'.$name.'</strong></div>
                <table width="100%"  class="extra" cellspacing="1" cellpadding="5" border="0" >
                <tr class="bgC3" style="font-weight:bold">
                    <td width="20"></td>
                    <td>Deri</td>
                    <td width="50">Çmimi</td>
                    '.managment::cmimet_e_caktuara($name).'
                </tr>
                </table>
                        <div class="buttoni">
                        <a href="#" class="lightbox">test</a>
                        <div class="boxi">'.$name.'</div>
                            <form action="" method="POST">                          
                            <input type="text" name="new_city">
                            <input type="hidden" name="prej" value="'.$name.'"> 
                            <input type="submit" name="new_dest" value="Shto destinacionin">
                            </form>
                        </div>
                </div>';
    }
}
  • 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-23T01:26:13+00:00Added an answer on May 23, 2026 at 1:26 am

    It looks like you’re wanting to turn a div into a lightbox? You could just try adjusting your current CSS on .boxi to display: none; and set a z-index on it before – then adjust your javascript to something like this:

    $('.lightbox').click(function(){
        $('.boxi').show();
        return false;
    });
    

    You could get much more complex with grabbing the next lightobx container when .lightbox is clicked – I’d recommend checking out the plugin Fancybox at fancybox.net, that’s the one I typically use. Good luck!

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

Sidebar

Related Questions

my problem has to do with the SimpleModal jQuery plugin . I have no
The superbox is a jquery plugin that has lightbox effect. My problem is how
I have a css problem with jquery / jquery ui / auto complete <script
I have a set of jQuery UI tabs that each load project.php using ajax.
For some reason one installation of Moodle 1.9.3+ has a problem that file.php returns
This problem has been kicking my butt for a few days now. I have
This problem has bugged me so many times and i have now decided to
I'm using uploadify (a jQuery uploading) script, which has basically a PHP file at
I have a php page that uses php sessions as well as jquery to
The Problem I have a page with a form on. It has a hidden

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.