Introducing DOCJSLIB 3.0, The Vertical Positioning Function - Doc JavaScript | WebReference

Introducing DOCJSLIB 3.0, The Vertical Positioning Function - Doc JavaScript


The Vertical Positioning Function

DOCJSLIB Version 2.0 supported the setPosFromLeft() function for horizontal positioning. Version 3.0 adds a matching function, setPosFromTop():

function docjslib_setPosFromTop(id, yCoord) {
  if (NS4) {eval("document." + id).top = yCoord}
  else {eval("document.all." + id).style.top = yCoord}
}

This functions has two parameters:

As previously explained in this and previous columns, top is a property of the DHTML element on Netscape Navigator, but it is a property of the style object on Internet Explorer.

http://www.internet.com


Created: November 9, 1998
Revised: November 9, 1998

URL: http://www.webreference.com/js/column29/position.html