I am having a strange div-layout problem. I have a footer
div .The footer works properly in mozilla, bit in IE 7 and 8, it comes up inside the primary-content
layout.
Find the screen shot below :
I have seen all the usual solutions by googling them out, yet nothing worked.
Can some one suggest how to solve this weird problem ?
EDIT :
I am employing div-collision-detection
here like this :
//Detecting div collision
var class1 = '';
var class2 = '';
//primary
var cTop = jQuery('#primary').offset().top;
var cLeft = jQuery('#primary').offset().top;
var cBottom = jQuery("#primary").offset().top + jQuery("#primary").height();
var cRight = jQuery("#primary").offset().left + jQuery("#primary").width();
var cHeight = jQuery("#primary").height();
//myFooter
var fTop = jQuery('#myFooter').offset().top;
var fLeft = jQuery('#myFooter').offset().top;
var fBottom = jQuery("#myFooter").offset().top + jQuery("#myFooter").height();
var fRight = jQuery("#myFooter").offset().left + jQuery("#myFooter").width();
var fHeight = jQuery("#myFooter").height();
var divs = [
{class1:'#primary', top:cTop, left:cLeft, height:cHeight},
{class2:'#myFooter', top:fTop, left:fLeft, height:fHeight}
];
for (var i=0; i < divs.length - 1; i++)
for (var j=i+1; j < divs.length; j++)
{
var I=divs[i];
var J=divs[j];
if ( (I.top <= J.top && (I.top + I.height) >= J.top) ||
(J.top <= I.top && (J.top + J.height) >= I.top) ){
alert(I.class1 + " collides with " + J.class2);
//What to do here ??
}
}
What i don't understand is : how do i push the footer down after i detect the collision ?