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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:23:05+00:00 2026-05-15T09:23:05+00:00

I need to display an image in a resizable dialog (so far all the

  • 0

I need to display an image in a resizable dialog (so far all the specific image popup libraries I have tried do not fit my needs).

All I want to do is maintain the aspect ratio during resizing. Sounds easy, but it’s not.

I thought something like this might work, but no dice:

var d = $("").dialog({title:title, width:400, height:400});
d.resizable( "option", "aspectRatio", true );

Any pointers greatly appreciated, tks

  • 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-15T09:23:06+00:00Added an answer on May 15, 2026 at 9:23 am

    Due to the way it’s hooked in, I find it easiest to just do the resizable portion yourself, like this:

    $("div").dialog({
        title:"Title", 
        width:400, 
        height:400, 
        resizable: false
    }).parent().resizable({ 
        handles: 'n,e,s,w,se,sw,ne,nw', 
        aspectRatio: true 
    });​​​
    

    You can view a demo here, you can also destroy and re-create it…but that’s a bit wasteful, so just create it above, specify the max/min height/width in the resizable instead of the dialog if needed. This should work: .parent().resizable("option", "aspectRatio", true), but it doesn’t due to the way the widgets hooked in, so the eaiest solution is to just create the resizable yourself with the options you want when you create the dialog.

    Side note: you’re using .parent() here because you wan the dialog container that contains the title bar and your content. It’s created/wrapped like this when you create the dialog.

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

Sidebar

Related Questions

I have a page in my wp7 application which need to display an image
I need to display image that is in file system not in project directory
I need to display an image, which I've done without problems before, but today
I need to display 2d images in opengl using textures. The image dimensions are
I display set of images(small). I need to show the larger image(300*300) at some
I have a custom asp.net server control to display images.What I need now is
I need to display an image in a Django form. My Django form is
I need to display in image on the view this way <img src =
I need to display image in openGL window. Image changes every timer tick. I've
I need to display image with rounded corner with sprite. What is the best

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.