Netscape 6, Part VI: Object-Oriented DOCJSLIB 1.2: docjslibSuperClass.js - Doc JavaScript | WebReference

Netscape 6, Part VI: Object-Oriented DOCJSLIB 1.2: docjslibSuperClass.js - Doc JavaScript


Netscape 6, Part VI: Object-Oriented DOCJSLIB 1.2

docjslibSuperClass.js

<!--
// Begin docjslib version 1.2. Released February 12, 2001.
// This is docjslib library. 
// It begins in this comment and continues until the matching comment, "End docjslib ...".
// It should not be normally touched. 
// docjslib is a cross-browser library. You should not worry about the browser in your code.
// This version includes the following functions:
//   getSrc (gets the image URL of an HTML element)
//   setSrc (sets the image URL of an HTML element)
//   makeImage (creates an HTML element)
function docjslibSuperClass() {
  this.makeImage = makeImageMethod;
  function makeImageMethod(imgID,          // given id
                   imgURL,         // image URL
                   imgHeight,      // image height
                   imgWidth,       // image width
                   imgAlt,         // alternative image
                   posFromLeft,    // absolute position from left of window
                   posFromTop,     // absolute position from top of window
                   clickParam1,    // parameter passed to "onclick" handler
                   clickParam2)    // parameter passed to "onclick" handler
  {
    document.write(
    '<STYLE TYPE="text/css">',
    '#', imgID, ' {',
      'position: absolute;',
      'left: ', posFromLeft, ';',
      'top: ', posFromTop, ';',
      'width: ', imgWidth, ';',
      'z-index: 1',
    '}',
    '</STYLE>',
    '<DIV ID="', imgID, '">',
    '<A HREF="javascript:', "handleImageClick('", imgID, "'", ',', clickParam1, ',', 
    clickParam2, ')">',
    '<IMG NAME="', imgID, 'img" ID="', imgID, 'img" SRC="', imgURL, '" ALT="', imgAlt, 
    '" BORDER="0" ', 'HEIGHT="', imgHeight, '" WIDTH="', imgWidth, '">',
    '</A></DIV>'
    );
  }
}
//
// End docjslib Version 1.2
//
// -->

Next: Browser-dependent subclass for IE4

https://www.internet.com


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

URL: https://www.webreference.com/js/column77/13.html