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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:05:19+00:00 2026-06-17T14:05:19+00:00

I have a enlarge image from thumb to large by ajax using click. they

  • 0

I have a enlarge image from thumb to large by ajax using click.

they using the same html elements just replace the img src
for example:

src="image_thumb.jpg"

switch to

src="image_large.jpg"

My question is, how to switch back to the thumb image when the user clicks again.

  • 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-17T14:05:20+00:00Added an answer on June 17, 2026 at 2:05 pm

    Since toggle is deprecated in 1.8 and removed in 1.9, you should do this

    $('img').on('click', function(){
      var $this = $(this);
      if ($this.data('originalSrc')){
        $this.prop('src', $this.data('originalSrc'));
        $.removeData(this, 'originalSrc');
      } else {
        $this.data('originalSrc', $this.attr('src'));
        $this.prop('src', 'image_large.jpg');
      }
    });
    

    DEMO http://jsfiddle.net/PSFeJ/

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

Sidebar

Related Questions

have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I am playing around with AJAX functionality using ASP.NET MVC. I have created a
I have four or five thumbnails next to a full-size image. When I click
I have a single image with buttons aligned vertically. I then am using css
I have code which uses system.net.mail to send html formatted emails. They show up
I have a class of images I want to enlarge (but remain in place)
I have a Bitmap that I want to enlarge programatically to ~1.5x or 2x
Have deployed numerous report parts which reference the same view however one of them
I have a function below which is called to reload a recaptcha image. It
I have a pinch gesture recognizer attached to an imageview from which I use

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.