From: Gabriel Wicke Date: Mon, 19 Apr 2004 16:12:12 +0000 (+0000) Subject: ie6 disappearing float fix X-Git-Tag: 1.3.0beta1~379 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=eb2f5fa91d3641a8f028033ca20961f43cdf6a42;p=lhc%2Fweb%2Fwiklou.git ie6 disappearing float fix --- diff --git a/stylesheets/IEFixes.js b/stylesheets/IEFixes.js index a9a7428c14..0888561d9b 100644 --- a/stylesheets/IEFixes.js +++ b/stylesheets/IEFixes.js @@ -6,6 +6,7 @@ else var version = 0; window.attachEvent("onload", hookit); function hookit() { fixalpha(); + if(version == 6) relativeforfloats(); fixtextarea(); var wrapper = document.getElementById('tawrapper'); if(wrapper) wrapper.attachEvent("onclick", fixtextarea); @@ -50,3 +51,21 @@ function fixtextarea() { wrapper.style.width = (wrapper.offsetWidth - 4) + 'px'; } } + +// fix ie6 disappering float bug +function relativeforfloats() { + var bc = document.getElementById('bodyContent'); + if (bc) { + var tables = bc.getElementsByTagName('table'); + var divs = bc.getElementsByTagName('div'); + } + setrelative(tables); + setrelative(divs); +} +function setrelative (nodes) { + var i = 0; + while (i < nodes.length) { + if(nodes[i].style.float || nodes[i].align != '') nodes[i].style.position = 'relative'; + i++; + } +}