Transparency reference manual

made by 8 Dimensions ©

Description & features

The object defined in this JavaScript code summons an image in a specified corner of a webpage, that stays there regardless of any scrolling of the page. Based on the parameters provided at its creation time it can be a link at the same time and can disappear after a specified amount of time.

Classes

floatingLogo

Constructor

new floatingLogo(in_LogoPosition, in_ImageSrc, in_HOffset, in_VOffset, in_Link, in_Timeout, in_Title)

in_LogoPosition – Specifies in which corner of the page the image will appear. Possible values are lt (=left top), rt (=right top), lb (=left bottom) and rb (=right bottom)

in_ImageSrc – The address of the image. Can be relative to the page or absolute.

in_HOffset – Distance from vertical border (left or right depending on position) in pixels.

in_VOffset – Distance from horizontal border (top or bottom depending on position) in pixels.

[in_Link](optional) – If specified (and non-empty) the image becomes clickable linking to a page specified.

[in_Timeout](optional) – If specified a greater then zero, the floating image disappears itself after the specified number of milliseconds.

[in_Title](optional) – Title of the image; hint that appears if the mouse moves over the image (if the feature supported by the browser).

Properties

baseObject – The base div into which the image is wrapped. The object can be used to set further properties like border for example.

imgObject – Points to the image shown. Its additional properties can be set this way.

position – A text value determining the position of the image. Possible values are lt (=left top), rt (=right top), lb (=left bottom) and rb (=right bottom).

hOffset – Distance from vertical border (left or right depending on position) in pixels.

vOffset – Distance from horizontal border (top or bottom depending on position) in pixels.

notStatic – A flag indicating whether the browser supports postion:static or not. Should not be changed!

logoId – A unique ID of the image shown. For internal use, should not be changed!

active – Flag signaling whether the image is still visible or not.

Methods

hideLogo – Hides the image in case it's still visible.

showLogo – Shows the image in case it was already hidden.

scrolledDown – The number of pixels the page was scrolled down by.

scrolledRight – The number of pixels the page was scrolled right by.

viewportHeight – The width of the browser window.

viewportWidth – The height of the browser window.

checkPosition – Checks the image is on the right position. Should be called in case the position property was changed.

Usage

  1. Call new floatingLogo(..) with appropriate parameters whenever you need a floating image to appear (Should be in the <BODY> part of the page or in an event)

Hint: Assigning  the newly created object to a variable makes it possible to change the floating image properties later on.

Example:

...

<script type="text/javascript" language="JavaScript" SRC="../scripts/Dim8_floatinglogo.js"></script>

<script language="JavaScript" type="text/javascript">
<!--
var myLogo
//-->
</script>
</head>

<body onload="myLogo=new floatingLogo('rt','mylogo.gif',15,10,'http://www.mypage.net/',10000,'This is a floating logo')">
...

Compatibility

Compatible

Tested on

The compatibility with other browsers depend whether they support position:fixed or at least currentStyle property (correctly, not like IE 6 and lower which report fixed despite it is not)

Version history

1.0 3.III.2007 The first version released

Credits

The library was created by 8 Dimensions. Go to www.8dimensions.com to see more.