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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:54:41+00:00 2026-05-31T12:54:41+00:00

Here I’ve got some simple jQuery which sets the height of a series of

  • 0

Here I’ve got some simple jQuery which sets the height of a series of floated elements based on their width. Inside each element I have an image, which is forced to remain inside the floated elements using max-width and max-height.

This almost works perfectly. Chrome is giving me grief. While viewing that fiddle in Chrome, restore down Chrome and reduce Chrome’s width. Then, maximize Chrome. The images do not scale as they should.

I’ve tested this in Firefox, Internet Explorer, and Chrome. Chrome is the only one of those three that exhibits this behavior. How can I fix this??

Click here to see the fiddle.

  • 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-31T12:54:42+00:00Added an answer on May 31, 2026 at 12:54 pm

    The solution ended up being to use jQuery to “jiggle” the containing element, forcing Chrome to reevaluate the sizing of the contained images.

    The jsFiddle

    The new jQuery:

    var element = 'li';
    var ratio = 1.25;
    
    function makeProportional(element, ratio) {
        $(element).parent().css('width', '99%');
        var unitWidth = $(element).width();
        $(element).css('height',unitWidth*ratio);
        $(element).parent().css('width', '100%');
    }
    
    makeProportional(element,ratio);
    
    
    $(window).resize(function() {
        makeProportional(element,ratio);
    });
    

    EDIT:

    For anyone reading this later, this bug has been fixed. The original code (linked to in the question) now works.

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

Sidebar

Related Questions

Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here a simple question : What do you think of code which use try
Here is binding: <Image Width=16 Height=16 Source={Binding SwitchForImage, Converter={StaticResource stringToImage}} HorizontalAlignment=Left> </Image> and here
Here is an example: I have a file 1.js, which has some functions. I
Here is my code, which takes two version identifiers in the form 1, 5,
I have just tried to save a simple *.rtf file with some websites and
Here is a scenario: User installs .NET application that you have made. After some
Here's what I'm trying to do... It's quite simple and obviously there must be
Here is my question. I am having this simple menu. <div id=menu> <ul> <li>
Here is a snippet of my xaml: <ComboBox x:Name=cbo1 Width=100 SelectedValue=200> <ComboBoxItem Name=n1>100</ComboBoxItem> <ComboBoxItem

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.