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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:56:10+00:00 2026-05-13T21:56:10+00:00

I have multiple images that have the same class attribute and I want to

  • 0

I have multiple images that have the same class attribute and I want to resize all the images uniformly even though they all have different original widths – how can I do this using jQuery?

<img id=img1 class="ResizeMe" src="img1.gif" width="100" height="100" /><br />

<img id=img2 class="ResizeMe" src="img2.gif" width="200" height="200" /><br />

<img id=img3 class="ResizeMe" src="img3.gif" width="150" height="150" /><br />

<input id="Button1" type="button" value="Shrink Images by 10%" />
<input id="Button2" type="button" value="Grow Images by 10%" />

TIA!

UPDATE: Here’s the final working code I used for anyone hitting this in the future…

        function OnClientValueChanging(sender, args) 
        {
            var zoomPercentage = args.get_newValue() / 100;

            $(".ApplyZoomEffect").each(function () {
                var newWidth = parseFloat($(this).attr('OriginalWidth')) * zoomPercentage;
                var newHeight = parseFloat($(this).attr('OriginalHeight')) * zoomPercentage;
                $(this).css('width', newWidth + "px").css('height', newHeight + "px");
            });
        }
  • 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-13T21:56:10+00:00Added an answer on May 13, 2026 at 9:56 pm

    Try this style:

    $("#Button1").click(function() {
      $(".ResizeMe").width(function(i, w) { return w * 0.9 })
                    .height(function(i, h) { return h * 0.9 });
    });
    
    $("#Button2").click(function() {
      $(".ResizeMe").width(function(i, w) { return w * 1.1 })
                    .height(function(i, h) { return h * 1.1 });
    });
    

    Since jQuery 1.4.1, you can pass a function to .width() and .height() to accomplish this more cleanly.

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

Sidebar

Related Questions

I have a table with multiple rows that all have the same class. When
I have an application that requires processing multiple images in parallel in order to
If we have a website with multiple images and videos, I've read that it's
For a client I have build a simple script that uploads multiple files(images), resizes
I'm having multiple images (all which are clickable and have a value associated with
I have a question regarding jQuery. I have multiple images that are, in essence,
I have a Camera class that produces very large images at a high FPS
I have multiple images taken simultaneously pointing at the same direction from the same
I have multiple webpages that work together. Most of them have the same css
so I have multiple divs of the same class below each other. I now

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.