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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:40:03+00:00 2026-06-02T15:40:03+00:00

i am using following way to open the image in light box but it

  • 0

i am using following way to open the image in light box but it opens the image which is selected i want that when i click any image it should open another images how to do this

<script type="text/javascript" >
    $(document).ready(function(){
        $(".linkbutton").click(function(){
            var address= $(this).attr("src");
            $("#popup").fadeIn("slow");
            $("#lightbox").attr("src",address);
        });
        $("#close").click(function(){
            $("#popup").fadeOut("fast");
        });
    });
</script>

Following in body

<div>
    <img src="image/smallicon_2.png" class="linkbutton">
</div> 

<div id="popup">
    <div id="center">
        <img id="lightbox" src="image/popup_page_1.png" >
        <img id="close" src="images/close.png" alt="close" >
    </div>  <!-- #center --> 
</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-06-02T15:40:05+00:00Added an answer on June 2, 2026 at 3:40 pm

    Add an attribute in the image element to reference the new image:

    <img src="image/smallicon_2.png" class="linkbutton" data-light="image/bigimage_2.png" />
    

    Then replace:

    var address= $(this).attr("src");
    

    with:

    var address= $(this).attr("data-light");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following image repesent that I want to. *dgCommon classes has a no problem. I
I tried to reuse the .pch to speed the build using the following way:
I've been using ShowDialog() in following way for all my new Windows. SomeGui test
I am using apache ant in the following way: I have projects P1, P2,
I am using the following class written by Mark Brittingham for two way AES
Using C# I was trying to develop the following two. The way I am
Is there a better way of writing the following method? Using LINQ maybe? Instead
I'm using ereg in the followin way to validate a field which can contain
I'm looking for the correct way of using wp_get_attachment_image(). The following code: <?php $args
I've been using the following CSS dropdown box on my website, and I've noticed

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.