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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:58:55+00:00 2026-06-13T04:58:55+00:00

I have a lot thumbnail images, when I click one, the original bigger image

  • 0

I have a lot thumbnail images, when I click one, the original bigger image will be displayed. It will replace the default image “manifier.jpg” in the position of elementId “main”.
My code:

<img src="magnifier.jpg" name="main" id="main">
<br>
<br> 

 <a href="IMG_0554.JPG" onclick="swap(this); return false;"><img src="tn_IMG_0554.JPG"></a> 
 <a href="IMG_0566.JPG" onclick="swap(this); return false;"><img src="tn_IMG_0566.JPG"></a> 
 <a href="IMG_0570.JPG" onclick="swap(this); return false;"><img src="tn_IMG_0570.JPG"></a>

And

<script type="text/javascript"> 
     function swap(image) { 
         document.getElementById("main").src = image.href; 
     } 
 </script> 

It works perfectly. My question, if I followed the steps.

  • 1) Clicking thumbnail image.
  • 2) Bigger image is shown.
  • 3) Clicking the bigger image.

    I want the default image will be displayed.

How to changed the code?

  • 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-13T04:58:56+00:00Added an answer on June 13, 2026 at 4:58 am

    Just add an onclick event for the main img and reset it back to magnifier.jpg

    <img id="main" name="main" onclick="this.src='magnifier.jpg'; return false;">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have lot of thumbnail and I want to show check box on images
I have a Django application that have a lot of images items that have
I have a page that contains a lot of images, but it's a page
I am looking for lightweight image processing tool that will resize images to JPEG
I have a need to display a lot of image thumnails in a small
I have the following combo box which sets the number of images displayed per
I have a lot of thumbnails with small images in them, and when the
I have lot of products with custom options, now I have requirement to update
I have lot of code in my Tornado app which looks like this: @tornado.web.asynchronous
We have lot of object with this kind of design : Interface and several

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.