close
The Wayback Machine - https://web.archive.org/web/20150317173019/https://www.hscripts.com/scripts/JavaScript/scroll-position.php

Page Screen Resolution

This java script function helps you to find the screen resolution. It helps you to know the color quality of your web page.

Features

  • The javascript function will help you to find your screen resolution.
  • This screen resolution script helps you to know the color quality of your web page.
  • Just copy the code in to your page and use it.

Preview

You can see the scroll position of the scroll bar on the bottom left corner of this page.

Downloads


<!-- Script by hscripts.com-->
<!-- more scripts @ https://www.hscripts.com -->
<script type="text/javascript">
var corner = "bottomleft";
document.write("<div id=ddd style=\"position: absolute; background-color:#454545; text-align:center; visibility: visible; top: 5px; left:5px; color:white; font-family:arial,verdhana; font-size:11; font-weight:bold; width:145px;\">Your current scroll bar positions :<br><input id=dur disabled type=text style=\" border:0px; background-color:#454545; text-align:center;
color:white; font-family:arial,verdhana;
font-size:11; font-weight:bold\"></div>");
var os;
if(document.layers)
os = "n4";
else if(document.getElementById&&!document.all)
os = "n6";
else if(document.all)
os = "ie";
var top_pos;
var left_pos;
function scrollDetect(){if (navigator.appName == "Microsoft Internet Explorer"){pwidth = window.document.body.offsetWidth;pheight = window.document.body.offsetHeight;top_pos = document.body.scrollTop;left_pos = document.body.scrollLeft;ele = document.getElementById('dur');ele.value = top_pos + " X " + left_pos;
}
else{pwidth = window.innerWidth;pheight = window.innerHeight;top_pos = window.pageYOffset;left_pos = window.pageXOffset;ele = document.getElementById('dur');ele.value = top_pos + " X " + left_pos;}var dda = document.getElementById('ddd');
if(corner == "topleft"){dda.style.top = (top_pos+15)+"px";dda.style.left = (left_pos+15)+"px";
}else if(corner == "topright"){dda.style.top = (top_pos)+"px";dda.style.left = (left_pos+pwidth-70)+"px";
}else if(corner == "bottomleft"){
dda.style.top = (top_pos+pheight-60)+"px";dda.style.left = (left_pos+15)+"px";
}else if(corner == "bottomright"){
dda.style.top = (top_pos+pheight-60)+"px";dda.style.left = (left_pos+pwidth-110)+"px";
}
}
setInterval('scrollDetect()',5);
document.onload = scrollDetect();
</script>
<!-- Script by hscripts.com -->

  • Release Date - 02-01-2007
  • Get free version without ©copyright link for just $5/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy the code in to your page.
  • You can place the scroll bar position javascript at topright/topleft/bottomright/bottomleft corner of the page just by changing the variable "corner".(eg: var corner = "topright";)
  • Note: Use only the keywords specified above.
  • This free bookmarking JavaScript is tested in windows IE, firefox and opera.

License

  • The javascript (misspelled as java script) is given under GPL License.
  • i.e. Free use for those who use it as it is.
  • Free, if your modification does not remove our copyright information and links.
  • Detailed License information can be found here.
  • You can purchase the script if your requirements does not meet GPL License terms.

Related Scripts

Free Javascript Scripts