abstract:
var ab = document.getElementById('left').offsetTop + document.getElementById('left').offsetHeight;
var ac = document.getElementById('right').offsetTop + document.getElementById('right').offsetHeight;
var total = gh
if(ab > total){ total = ab; }
if(ac > total){ total = ac; }
footer.style.top = total;
In internet explorer the script works fine and in firefox it does mpt work, the footer div stays at position -300
Hello,
I have a website made of 4 div's that are set with have these settings:
Code:- #all { color: white; font-size: 10px; background-color: #282828; position: relative; width: 532px; min-height: 740px; margin: 7px auto 30px; padding: 348px 297px 10px 174px; }
- #left { position: absolute; top: 348px; left: 0; }
- #footer { position: absolute; top: [b]-300px[/b]; left: 0; }
- #right { position: absolute; top: 609px; right: 0; width: 131px; }
Copy Code Because the all, left and rights div's variate in size I made a javascript that moves the footer div to the appropiate place at the bottom of the page.
Code:- var gh = document.getElementById('all').offsetHeight;
- var ab = document.getElementById('left').offsetTop + document.getElementById('left').offsetHeight;
- var ac = document.getElementById('right').offsetTop + document.getElementById('right').offsetHeight;
- var total = gh
- if(ab > total){ total = ab; }
- if(ac > total){ total = ac; }
- footer.style.top = total;
Copy Code In internet explorer the script works fine and in firefox it does mpt work, the footer div stays at position -300 |