Javascript

JS to tell if an object is viewable on the screen

Here is some JavaScript that has a function to tell if an object is viewable on the screen. This is quite helpful if you have something on the screen you want to make sure the user sees, like a an error or license agreement, etc. <HTML> <HEAD> <SCRIPT> function isinView(oObject) { var oParent = oObject.offsetParent; var iOffsetTop = oObject.offsetTop; var iClientHeight = oParent.clientHeight; if (iOffsetTop > iClientHeight) { alert("Special Text not in view. Expand Window to put Text in View."); } ...