Hi
From http://www.gogolek.com I wanted to implement my "sliding content" script on http://www.id.uw.edu.pl/zajecia.htm?zajecia=.rie (click "Więcej o zajęciach" to observe effect), unfortunately- while in FF it works flawlessly, IE fails without error. I isolated problem to this one:
In this particular configuration sectObj.offsetHeight is always 0 in every iteration, I have no idea why is that (it works perfectly in www.gogolek.com, and I don't see any major difference in code or style). The wild workaround is to hardcode a value into absHeight[i], but I don't think it's elegant solution at all.Code:function grab() { for (var i = 1; i <= 10; i++) { sectObj = document.getElementById("sect" + i); tmpHeight[i] = 0; if (sectObj) { absHeight[i] = sectObj.offsetHeight; } hideStep[i] = Math.round(100 / Math.round(absHeight[i] / 45)); showStep[i] = Math.round(100 / Math.round(absHeight[i] / 35)); tmpOpacity[i] = "100"; } }
Referenced thread: http://www.dynamicdrive.com/forums/s...ad.php?t=14670



Reply With Quote
Bookmarks