473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

find page length

is there a function in JavaScript to find the total height of your
page? this value should INCLUDE the unseen space you have to scroll
down to see.

The Ypageoffset function seems to be close to what i want. but i want
the value when the scroll bar is at the bottom of the page at load
time, instead of waiting for the user to scroll down themselves.

any ideas? thanks.

Oct 28 '06 #1
3 5411
ASM
fi***********@gmail.com a écrit :
is there a function in JavaScript to find the total height of your
page? this value should INCLUDE the unseen space you have to scroll
down to see.

The Ypageoffset function seems to be close to what i want. but i want
the value when the scroll bar is at the bottom of the page at load
time, instead of waiting for the user to scroll down themselves.

any ideas? thanks.
an anchor in bottom of page ?
Oct 28 '06 #2

fi***********@gmail.com wrote:
i want
the value when the scroll bar is at the bottom of the page at load
time, instead of waiting for the user to scroll down themselves.
It sounds like you want to know the page's maximum displacement. If so,
this is the way that I have done it in the past.
Instead of calculating from a range of properties, it attempts to
scroll down 10 Megapixels, then it reads the actual displacement before
scrolling back to the top.
Call it on load or later:

<SCRIPT type='text/javascript'>
function getScrollHeight()
{
var maxDisplacement=0;

window.scrollTo(0,10000000);

if( typeof self.pageYOffset!='undefined' )
maxDisplacement=self.pageYOffset;
else
if( document.compatMode && document.compatMode != 'BackCompat' )
maxDisplacement=document.documentElement.scrollTop ;
else
if( document.body && typeof(document.body.scrollTop)!='undefined' )
maxDisplacement=document.body.scrollTop;

window.scrollTo(0,0);

return maxDisplacement;
}

window.onload=function(){alert(getScrollHeight())}
</SCRIPT>

Oct 29 '06 #3
fi***********@gmail.com wrote:
is there a function in JavaScript to find the total height of your
page? this value should INCLUDE the unseen space you have to scroll
down to see.

The Ypageoffset function seems to be close to what i want. but i want
the value when the scroll bar is at the bottom of the page at load
time, instead of waiting for the user to scroll down themselves.
http://developer.yahoo.com/yui/docs/...ViewportHeight
Oct 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: rkleiner | last post by:
Is there a regular expression to find the first unmatched right bracket in a string, if there is one? For example, "(1*(2+3))))".search(/regexp/) == 9 Thanks in advance.
3
by: Bob Stearns | last post by:
I changed a varchar(255) to varchar(3000) an started receiving: Warning: odbc_exec(): SQL error: SQL1585N A system temporary table space with sufficient page size does not exist. SQLSTATE=54048...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: sunil | last post by:
How do I find the length of page in target iframe? I am looking for the code or give me idea to find the length
7
by: =?Utf-8?B?Um9iIFRob21zb24=?= | last post by:
Hi is there a way in asp.net 1.1 to in code behind query the page size that is generated, I realise IIS does it as it has that data in the logs, I would like to capture this data so that I can...
1
by: amiparna | last post by:
There is two frame in my form.In d first frame there is a text box,and i give some word in the text box.I want to search the word from a file from the location(http://45.12.09.31...........) and if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.