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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:13:11+00:00 2026-05-17T02:13:11+00:00

The scenario: I’m building a website, which will not Host the images in its

  • 0

The scenario:

I’m building a website, which will not Host the images in its own server. Instead it will reference images from other servers.

Example: The website is hosted at http://www.mywebsite.com, and the html of the images will be something like <img src=”http://www.otherwebsite.com” />.

The images from the other servers will be already compressed, so they won’t be very heavy… although they will have around 25KB each, with 500×375 pixels.


The objective:

I want to resize them on the client side, with the help of jQuery. So they became thumbnails.

There are two sizes of thumbnails: 310×140 and 80×80 pixels.

However, not only I want to resize them, has I probably would want them to be zoomed. Because if the original image is only 260px wide, that means that the image would need to be zoomed and then “cropped”, so it would fill the full 310px instead of leaving an empty space on the sides.

I know that I am being too demanding. But I thought that this was a “common” situation that many of you may had dealt with already… so maybe there is some sort of plugin that would do this.

I also know that this means that the user is loading images “heavier” than they are needed, because if they already had 310×140 before loading (which is the thumbnail size), they would be much lighter… but hey! It isn’t my fault that the project was built this way.


The research:

I did found something that almost did what I wanted, with the exception of the “zooming”.
You can check by clicking here: http://joanpiedra.com/jquery/thumbs/.

  • 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-17T02:13:12+00:00Added an answer on May 17, 2026 at 2:13 am

    you can easily do it by maintaining the aspect ratio.

    define max width and max height.

    by maintaining aspect ratio resize them.

      if ((h / w) < (maxH / maxW)) {
                    $img.css('height', '');
                    $mg.css('width', maxW);
                }
                else {
                    $Img.css('height', maxH);
                    $Img.css('width', '');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a Java application which will download a HTML page from a website
Scenario: Every page on the website will have a menu bar at the top
Scenario: building a site where navigation will be in master page in either left
Scenario: I'm building an order-form. Like every other order-form on the planet, it has
I'm building an iOS app, which provides a service which our website already provides.
I'm building a website that will authenticate users via Facebook connect and I'm torn
I have the following scenario: I have a ShoutCast-ish server which serves out radio
Scenario: Making an Android app using data from a website built with Wordpress. The
I'm building a client server application from an android device to a server over
Scenario I am building a database that contains a series of different tables. These

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.