By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

Getting Around IE7 Bug

P: n/a
Sorry, this isn't specifically related to PHP, but to an odd bug I
came across when testing some code inside IE7.

The problem is that IE7 freezes, but only when the following
conditions are met:

1. An image inside of a block-level container, A, where the image is
enlarged or shrunk by CSS to have a width of 100%, which makes it
stretch to fill the container.

2. The container, A, is floating and its "max-width" property
(unsupported in IE7) is emulated with the following property:

width: expression(
this.clientWidth this.parentNode.clientWidth / 3 ?
"33%" :
"auto");

which basically has the effect of setting its max-width to 33% using
JavaScript. For more on the expression() function, look at
http://www.svendtofte.com/code/max_width_in_ie/

3. The container, A, is inside of another block-level container, B,
whose width is set by CSS.

Example code:

<style type="text/css">
..boundingbox {
width: 800px;
border: 1px dotted black;
}

..image {
float: right;

/** setting a maximum element width **/
/* for sensible browsers */
max-width: 33%;

/* for internet explorer
* note: this seems to be a bit buggy -- it seems to work, however,
if
* the image's bounding box is not given a width by CSS
*
* for more information on the "expression()" function, go to
* http://www.svendtofte.com/code/max_width_in_ie/
*/
width: expression(
this.clientWidth this.parentNode.clientWidth / 3 ?
"33%" :
"auto");
}

/**
* make sure the images inside obey their parent's sizing rules
*/
..image img {
width: 100%;
}

</style>

<div class="boundingbox">

<div class="image"><img src="http://128.104.64.199/big_image.jpg"></
div>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Suspendisse id leo ac magna pharetra ultrices. Duis non orci eu justo
imperdiet aliquam. Suspendisse mollis nulla vel pede. Aliquam id est a
mi fringilla rutrum. Pellentesque euismod adipiscing lectus. Ut eu
sapien. Curabitur libero ligula, luctus commodo, sagittis quis,
aliquet vitae, leo. Pellentesque et purus.</p>

</div>
Aug 29 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 29 Aug, 15:03, h3xx <amphetamach...@gmail.comwrote:
Sorry, this isn't specifically related to PHP,
It isn't even generally related to php. So why post it here?
Aug 29 '08 #2

P: n/a
On Aug 29, 9:28*am, Captain Paralytic <paul_laut...@yahoo.comwrote:
On 29 Aug, 15:03, h3xx <amphetamach...@gmail.comwrote:
Sorry, this isn't specifically related to PHP,

It isn't even generally related to php. So why post it here?
Because comp.lang.html doesn't exist and I thought a bunch of PHP
hackers might be used to dealing with browsers' problems.
Aug 29 '08 #3

P: n/a
h3xx wrote:
On Aug 29, 9:28 am, Captain Paralytic <paul_laut...@yahoo.comwrote:
>On 29 Aug, 15:03, h3xx <amphetamach...@gmail.comwrote:
>>Sorry, this isn't specifically related to PHP,
It isn't even generally related to php. So why post it here?

Because comp.lang.html doesn't exist and I thought a bunch of PHP
hackers might be used to dealing with browsers' problems.
comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.stylesheets

......there are some knowledgeable helpful and often crabby ogres over
there too.

--
cut the board three times and it's still too short
Aug 29 '08 #4

P: n/a
sliverdigger wrote:
h3xx wrote:
>On Aug 29, 9:28 am, Captain Paralytic <paul_laut...@yahoo.comwrote:
>>On 29 Aug, 15:03, h3xx <amphetamach...@gmail.comwrote:

Sorry, this isn't specifically related to PHP,
It isn't even generally related to php. So why post it here?

Because comp.lang.html doesn't exist and I thought a bunch of PHP
hackers might be used to dealing with browsers' problems.

comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.stylesheets

.....there are some knowledgeable helpful and often crabby ogres over
there too.
Or even alt.html...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 29 '08 #5

P: n/a
While the city slept, Jerry Stuckle feverishly typed:
sliverdigger wrote:
[...]
>comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.stylesheets

.....there are some knowledgeable helpful and often crabby ogres over
there too.

Or even alt.html...
Indeed... We're even more crabby over there! ;-)

Cheers,
Nige
--
Nigel Moss | http://www.nigenet.org.uk
Email not valid. ni***@dog.nigenet.org.uk - take the dog out!
"You're mother ate my dog!", "Not all of him..."
Aug 30 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.