|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
.scrollHeight in firefox.
In reference to another post.. http://www.webdeveloper.com/forum/sh...ad.php?t=73044
calling scrollHeight in firefox seems to only return the visible height of a div. Is there anyway to calculate the entire height of a div? |
|
#2
|
|||
|
|||
|
Have you tried offsetHeight
__________________
The Silent One The most dangerous thing in the world is an idea. The most dangerous person in the world is one with an idea |
|
#3
|
|||
|
|||
|
Yeah, offsetHeight does the same thing.
|
|
#4
|
|||
|
|||
|
Can you post your code?
Or try the following PHP Code:
__________________
The Silent One The most dangerous thing in the world is an idea. The most dangerous person in the world is one with an idea Last edited by Mr J; 07-18-2005 at 01:40 PM. |
|
#5
|
|||
|
|||
|
Thanks for the response Mr J. That code works fine fore me as well, but if the 'hello world' text extends past the bottom of the page it 'stops counting' so to speak.
Here's a simplified version of my code: PHP Code:
Last edited by cmor; 07-19-2005 at 02:43 PM. |
|
#6
|
|||
|
|||
|
bump. Thanks for the help thus far..
|
|
#7
|
|||
|
|||
|
bump again, does anyone have an instance of .ScrollHeight working differentlly in firefox?
|
|
#8
|
|||
|
|||
|
bump because as of now, I'm not seeing it, and it hasn't fixed itself.
|
|
#9
|
||||
|
||||
|
Try:
Code:
<div style="position:absolute; width:484px; left: 30px; top: 135px; line-height:12px;font-size:10px; font-family:arial; margin:0; padding:0; text-align:left; vertical-align:center" id="maintext"> Code:
<script type="text/javascript">
onload=function(){
alert(document.getElementById('maintext').scrollHeight)
}
</script>
Seems like a CSS issue to me.
__________________
My Threads: Random daily advice thread | Prototype Function Collection | Function Library XMLHttpRequest: Specification | xmlhttp object | open and onreadystatechange order | String.prototype.toXMLDocument | Sarissa | Prototype | Dojo Broadening one's horizons: 24ways.org Last edited by Ultimater; 07-20-2005 at 02:23 PM. |
|
#10
|
|||
|
|||
|
Thanks for the reply it seems that perhaps the formatting in my text was causing problems. I still do not totally understand why. If I remove all formatting it seems to work, even without the,
line-height:12px;font-size:10px; font-family:arial; added. Back to work on that. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|