• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Sproutee Inc

Sproutee Inc

Websites, Ecommerce, SEO G Suite

  • Portfolio
  • Pricing
  • Contact

jQuery min-height problem in IE7

You are here: Home / Web Design & Development / jQuery min-height problem in IE7

I mentioned in my previous post that I was having trouble with jQuery Dialog’s height in IE7, which curiously shrank or enlarged with alternate open/close events. Further investigation using the IE and FF web developer tools revealed that an in-line style, dynamically generated by jQuery, was setting the Dialog’s min-height property to either 0px or 56px with every other opening. The presence of this in-line style certainly explains why every attempt to override the height and min-height attributes in the CSS or with jQuery’s CSS functions failed to produce the desired display behaviour. My solution, which the developer tools in both browsers indicate is keeping minimum height at zero for every opening thus allowing the height default ‘auto’ to do its good work, is to use jQuery to set the min-height after the Dialog has been instantiated and opened (remember, dear reader, IE7 freaks out if you attempt to set the height or minHeight options in the Dialog constructor as per the API documentation).

So, first instantiate your Dialog, passing in those constructor arguments acceptable to IE7:

if($.browser.msie){
$("#confDialog").dialog({autoOpen: false, bgiframe: true, buttons: buttons, modal: true});
}

Next open the Dialog and reset the min-height attribute to zero:

$("#confDialog").dialog("open");
$(".ui-dialog-content").css("min-height", "0");

Because, as it seems, it is the open process that dynamically adds the in-line min-height to the Dialog’s content area mark-up, it is necessary to reset this property after invoking Dialog’s open function.

  • Share
  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)

23/01/2009 by Meg Smitley in Web Design & Development

Website Packages

Put your best foot forward.

Attract more leads with a professional website

Get started

Footer

Links

  • Home
  • About
  • Blog

Services

  • Free website audit
  • Web design & websites
  • Ecommerce websites

 

  • Marketing & SEO
  • G Suite
  • Hosting
  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
Copyright © 2023 Sproutee Inc · Privacy policy · Terms & conditions · Sitemap
This site tracks visits anonymously using cookies. We use this information to improve your experience of our site. You can opt-out if you choose.Accept Reject Read More
Privacy Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT