View Full Version : Distance Scrolled Down

11-23-2008, 08:44 AM
Besides my other thread (with 0 replies :confused: ) I have this other question. Is there anyway to detect how far from the top of the page I have scrolled?

I have a div that shows up but shows up in the top of the page if I am scrolled down the page.
(If I am at the very top it would show in the middle of the page, and will show there if I am all the way down the page). I would like it if I am scrolled down to show where I am positioned in the page at that moment.

11-23-2008, 01:32 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<style type="text/css">
body {

<script language="JavaScript" type="text/javascript">
function zxcWWHS(){
if (window.innerHeight) return [window.innerWidth-10,window.innerHeight-10,window.pageXOffset,window.pageYOffset];
else if (document.documentElement.clientHeight) return [document.documentElement.clientWidth-10,document.documentElement.clientHeight-10,document.documentElement.scrollLeft,document.documentElement.scrollTop];
return [document.body.clientWidth,document.body.clientHeight,document.body.scrollLeft,document.body.scrollTo p];

function Test(){


<script> vic=0; </script>
<form name=Show id=Show style="position:absolute;visibility:visible;top:420px;left:0px;" >
<input size=100 name=Show0 >
<input size=10 name=Show1 >
<input size=10 name=Show2 >
<input size=10 name=Show3 >
<input size=10 name=Show4 >
<input size=10 name=Show5 >
<input size=10 name=Show6 >
<input size=10 name=Show7 >
<input size=10 name=Show8 >
<input size=10 name=Show9 ><br>
<textarea name=TA rows=1 cols=100 ></textarea>