i69alot
09-24-2007, 05:24 AM
Hi:
I'm having some trouble with hiding and showing/animating divs. Given that
1) the number of divs is dynamic, it changes with each web page, AND
2) the amount of content on each div, and therefore the height of each is also dynamic
The trouble is, in order to show/animate a div the way I want, i need to know the height of any of these given divs *before* i show it. Assuming one such div is currently not in view, for example,
document.getElementById('some_div').style.display = 'none';
Is there any way I can get its height without displaying it or setting visibility to hidden? as it stands right now,
document.getElementById('some_div').style.height = 0;
because its display is set to 'none'. Can I somehow get the expanded (display = 'block') height of this div while its display is set to 'none'?
Any advice would be great. Thanks for all your help.
i69
I'm having some trouble with hiding and showing/animating divs. Given that
1) the number of divs is dynamic, it changes with each web page, AND
2) the amount of content on each div, and therefore the height of each is also dynamic
The trouble is, in order to show/animate a div the way I want, i need to know the height of any of these given divs *before* i show it. Assuming one such div is currently not in view, for example,
document.getElementById('some_div').style.display = 'none';
Is there any way I can get its height without displaying it or setting visibility to hidden? as it stands right now,
document.getElementById('some_div').style.height = 0;
because its display is set to 'none'. Can I somehow get the expanded (display = 'block') height of this div while its display is set to 'none'?
Any advice would be great. Thanks for all your help.
i69