Re: Javascript + CSS + IE

"John M. Hann" <[email protected]> Tue, 14 Nov 2006 13:45:07 -0000
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
Hey Adam,

Ryan may be right about the relative positioning.  I don't know
exactly why, but it seems that IE more correctly honors its box model
when it is using relative or absolute positioning.  This trick has
worked for me several times in the past for similar misbehaving with
both IE6 and IE7.  

Make sure that all of the parent nodes are also in one of these
positioning settings, too.  Well, try the direct parent first.  I
can't remember if I needed to go beyond that.

If I remember correctly, though, this problem is worse when using one
of the strict modes.  I see an XHTML namespace in the HTML tag, but I
am not sure if this is enough to trigger IE to enter "Standards Mode".  

Don't get me wrong on this: standards mode is the way to go for
cross-browser development.  It at least gets rid of many quirks you
would otherwise have to handle.  This just happens to be one of the
few unfortunate side-effects from putting IE in strict mode.  

Also, to get rid of IE's default selection behavior when dragging the
widgetHandle element, be sure to have the document's "selectstart"
event return false (well, "onselectstart" in IE).  

Regards,

-- John

http://e-numera.com/
http://ajax-web2.com/


--- In [email protected], "Ryan Hicks" <ryan.c.hicks@...> wrote:
>
> I've only just looked at your sample, but I have two thoughts based
on your
> description:
> 
>  
> 
> 1) The box model for IE and Gecko are significantly different.  If
you put
> IE into standards-compliant mode, it will behave a bit better.  Try
putting
> a doctype like: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
> Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" or
similar at
> the beginning of your document.  If that fails to address the
problem, then
> it still may be an issue with the box model, in which case all you
can do is
> monkey with the CSS until you find something that works.
> 
>  
> 
> 2) Try putting position: relative on some of the elements.  If your
design
> allows for that to be okay, it may help IE's rendering engine know
what to
> do with the elements.
> 
>  
> 
> -ryan
> 
>  
> 
>   _____  
> 
> From: [email protected] [mailto:[email protected]] On
Behalf Of
> Adam Griffis
> Sent: Monday, November 13, 2006 4:29 AM
> To: [email protected]
> Subject: [wdf-dom] Javascript + CSS + IE
> 
>  
> 
> Hello All,
> 
> I have run into a JS / CSS layout issue in IE, and I can't for the
life of
> me figure out what's going on. Basically, I have one DIV that is
expanding
> beyond the bounds of the containing DIV, and I've literally spent hours
> trying to find the problem. It appears to be somehow tied to the
> scrollbars, but again, I'm not sure.
> 
> The container is resizable height-wise by grabbing the bottom of the
> container, and the left and right columns within the container are
> resizable by grabbing the divider between them. If you play around with
> resizing it in various ways, the problem described above will come
and go.
> 
> I have pulled a portion of the site and simplified it to show only the
> problem, as I knew there would be no way to describe it...
> 
> http://www.griffisw <http://www.griffisweb.com/resize> eb.com/resize
> 
> Of course, it works just fine in Firefox. I was hoping the problem would
> disappear with IE7, but no such luck.
> 
> ANY help would be greatly appreciated, and I figure this is one of the
> better places to ask.
> 
> Thanks, everyone!
> Adam Griffis
> 
>  
> 
> 
> 
> [Non-text portions of this message have been removed]
>