Theory of Relativity

Relativity-formula

Recently whilst putting a .NET web project to bed we had yet more reports from the field of some rendering issues with Internet Explorer 7.  Of course we had tested IE 7 using the compatibility modes present within later versions of IE but seemingly this does not throw up many issues that arise in the ‘real’ browser

I know, I know…., in an ideal world we’d all have the latest and greatest browsers but in the real world companies are not so ‘lithe’ when it comes IT infrastructure.

The issue being reported was that one form displaying an accordion control, which in turn had embedded within it a scrollable div which in turn contained three or four divs as well as a JQGrid was having ‘issues of parentage’… When the main scrollable div was being scrolled all underlying divs were being rendered correctly and scrolling with the content whilst the JQGrid was not moving at all, just merely floating in space and generally getting in the way. After a lot of digging I found the following solution that cured my issues:- The main HTML was defined thus

<div id=”QuestionnaireGridContainer”>
<table id=’QuestionnaireGrid’></table>
</div>

 with the ‘QuestionnaireGrid’ being the location that the javascript JQGrid is rendered into, The issue however seems to lie with the parent div and not the JQGrid itself, what I needed to do was attach a style via the css to the ‘QuestionnaireGridContainer’ div like thus:

#QuestionnaireGridContainer{
    position:relative;
}

This ‘position:relative’ style  in this instance seems to explicitly force all children objects to behave correctly with regard to their location within time and space and now when i scroll my div content all child objects are scrolled exactly as I would expect.

Advertisements

Float Like a Butterfly….Errr

floatlabRecently whilst putting a .NET web project to bed we had some reports from the field of some rendering issues with Internet Explorer 7.  Of course we had tested IE 7 using the compatibility modes present within later versions of IE but seemingly this does not throw up many issues that arise in the ‘real’ browser

I know, I know…., in an ideal world we’d all have the latest and greatest browsers but in the real world companies are not so ‘lithe’ when it comes IT infrastructure.

One such issue being reported was along the following lines:-

Our application was divided into a standard navigation-detail model with the navigation part of the equation being a host of controls displayed within an accordion located to the left hand side of the screen and the detail being displayed to the right hand side of the screen in line horizontally with the accordion. This was achieved through the div hosting the ‘Detail’ section having a ‘float:right’ instruction within the css like so:-

.mainPageContainer{
    display: inline-block;
    float: right;
    height: 75%;
    width: 74%;
}
 
This seemed to work without issue throughout the entire development cycle… We targeted the following browsers:-
 
Internet Explorer 8/9/10 (and 7 in compatibility mode!)
Chrome
Firefox
Opera
Safari
 
All seemed to display without issue, it was left to ‘the real’ Internet Explorer 7 to lower the tone…. Instead of rendering the detail directly to the right of the accordion IE 7 rendered the details BELOW and to the right of the accordion. The fix turned out to be very simple though NOT obvious to me although with hindsight I do kind of understand, the issue was css related  but not with my mainPageContainer, rather the issue was with my accordionContainer which was defined thus:-
 
.accordionContainer{
    height:650px;
    min-width:20%;
    width:25%;
    display:inline-block;
}
 
It is not obvious, to me at least, that in order for any items placed to the right of the accordion to float right ‘properly’ the accordion container itself should be explicitly be made to float left (which it seems to do very well itself without instruction!). Thus I made the following bold changes:-
 
.accordionContainer{
    height:650px;
    min-width:20%;
    width:25%;
    display:inline-block;
    float:left;
}

 Voila, now even Internet Explorer 7 can now correctly render our application,