Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE max-height hack

Status
Not open for further replies.

jb13

Programmer
Oct 12, 2006
11
CA
Hi everyone,

There is a well known hack to use in stylesheet to replace max-height in internet explorer.

Code:
height:expression(this.scrollHeight > 100 ? "100px" : "auto");

When I use it on a DIV, there is no problem, but when I try to apply it to an IMG, internet explorer freezes in an infinite loop.

I found that some people have resolved it by giving non identical values, like this:

Code:
height:expression(this.scrollHeight > 102 ? "100px" : "auto");

But it still doesn't work on my image, someone can help me with that ?
 
How big is your image? The expression can be read like this:

if (scroll height > 102 pixels) //change this tou your image size... (i think)
set it to 100 pixels
else
set it to auto

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top