Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Max height in IE6

Posted on 2011-03-24
3
Medium Priority
?
363 Views
Last Modified: 2012-06-21
How do you perform max height in IE6?
0
Comment
Question by:PagodNaUtak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 668 total points
ID: 35205398
0
 
LVL 2

Assisted Solution

by:B_L_A_I_Z_E
B_L_A_I_Z_E earned 668 total points
ID: 35205405
Unfortunately, the only ways to achieve the max-height effect in IE6 are by using IE-specific CSS expressions, which are the equivalent of running JavaScript in a stylesheet, or by using JavaScript itself. Of the two, I recommend using the JavaScript solution as CSS expressions are expensive in terms of processing power and can cause the browser to crash. Both solutions will not function if JavaScript is disabled. Note that this solution is for IE6 only as all other browsers support max-height.

JavaScript

//Plain JavaScript, change the ID and dimensions to suit your code.
var container = document.getElementById('container');
container.style.height = (container.scrollHeight > 199) ? "200px" : "auto";

//An alternative function. Note: for dynamic resizing, attach to the window resize event
function setMaxHeight(elementId, height){
      var container = document.getElementById(elementId);
      container.style.height = (container.scrollHeight > (height - 1)) ? height + "px" : "auto";
}

//Example usage
setMaxHeight('container1', 200);
setMaxHeight('container2', 500);

   1. //Plain JavaScript, change the ID and dimensions to suit your code.
   2. var container = document.getElementById('container');
   3. container.style.height = (container.scrollHeight > 199) ? "200px" : "auto";
   4.
   5. //An alternative function. Note: for dynamic resizing, attach to the window resize event
   6. function setMaxHeight(elementId, height){
   7. var container = document.getElementById(elementId);
   8. container.style.height = (container.scrollHeight > (height - 1)) ? height + "px" : "auto";
   9. }
  10.
  11. //Example usage
  12. setMaxHeight('container1', 200);
  13. setMaxHeight('container2', 500);

Source: http://www.virtuosimedia.com/dev/css/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs#max-height
0
 
LVL 13

Assisted Solution

by:stergium
stergium earned 664 total points
ID: 35205413
hello.
according to this http://msdn.microsoft.com/en-us/library/cc351024%28v=vs.85%29.aspx
you cannot! i am not aware of a workaround for it
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question