spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column78


Netscape 6, Part VII: Object-Oriented DOCJSLIB 3.1

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Netscape Navigator 4.x Subclass Object Listing

<!--
function docjslibNS4SubClass() {
  this.inheritFrom = docjslibSuperClass;
  this.inheritFrom();
  
  this.getSrc = getSrcMethod;
  this.setSrc = setSrcMethod;
  this.setPosFromLeft = setPosFromLeftMethod;
  this.setPosFromTop = setPosFromTopMethod;
  this.setZposition = setZpositionMethod;
  this.setVisibility = setVisibilityMethod;
  this.doThisCommandEveryIntervalMS = doThisCommandEveryIntervalMSMethod;
  this.getWindowWidth = getWindowWidthMethod;
  this.getWindowHeight = getWindowHeightMethod;
  this.getPageScrollLeft = getPageScrollLeftMethod;
  this.getPageScrollTop = getPageScrollTopMethod;
  this.findHighestZ = findHighestZMethod;
  
  function getSrcMethod(id) {
    return eval("document." + id + ".document." + id + ".src");
  }
  
  function setSrcMethod(id, url) {
    eval("document." + id + ".document." + id).src = url;
  }
  
  function setPosFromLeftMethod(id, xCoord) {
    eval("document." + id).left = xCoord;
  }
  
  function setPosFromTopMethod(id, yCoord) {
    eval("document." + id).top = yCoord;
  }

  function setZpositionMethod(id, z) {
    eval("document." + id).zIndex = z;
  }

  function setVisibilityMethod(id, flag) {
    var str = (flag) ? 'show' : 'hide';
    eval("document." + id).visibility = str;
  }
  
  function doThisCommandEveryIntervalMSMethod(command, interval) {
  setInterval(eval('"' + command + '"'), interval);
  }

  function getWindowWidthMethod() {
    return window.innerWidth;
  }

  function getWindowHeightMethod() {
    return window.innerHeight;
  }

  function getPageScrollLeftMethod() {
    return window.pageXOffset;
  }

  function getPageScrollTopMethod() {
    return window.pageYOffset;
  }
  
  function findHighestZMethod() {
    var documentDivs = new Array();
    documentDivs = document.layers;
    var highestZ = 0;
    for (var i = 0; i < documentDivs.length; i++) {
      var zIndex = documentDivs[i].zIndex;
      highestZ = (zIndex > highestZ) ? zIndex : highestZ;
    }
    return highestZ;
  }
}
// -->

Next: A Final Word

http://www.internet.com


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: February 26, 2001
Revised: February 26, 2001

URL: http://www.webreference.com/js/column78/11.html