Webmonkey
Powered by Atomz.com



Quick Reference:

• Javascript Code Library
HTML Cheatsheet
Special Characters
Color Codes
Browser Chart
Stylesheet Guide
Unix Guide
Glossary
Domain Registries

Reference   JavaScript Code Library

This action positions one DHTML element a specified number of pixels away from another, based on the left, top, right, or bottom of the bounding box of each element. To use it, you must choose the element to position and the element to position against; you must specify which side of each element's bounding box to base the positioning on; and you must supply the number of pixels difference between the two. Optionally, you can choose the browser window as the element to position against by using the string window.

You can specify either a positive or a negative integer for the difference between the two elements. You can also mismatch sides (which can create some interesting effects).

Usage: WM_position2element('elementPositioned', 'left|top|right|bottom', differenceInPixels, 'elementPositionedAgainst|window', 'left|top|right|bottom');

Usage notes:

  • All arguments must be strings, with the exception of differenceInPixels, which should be a number.
  • You must set width and height for elementPositioned and elementPositionedAgainst.

Requires: WM_checkIn()

License: Webmonkey Public License

Cut, paste, and enjoy!


Feedback  |  Help  |  About Us  |  Contribute  |  Jobs
Advertise  |  Privacy Statement  |  Terms and Conditions

Copyright © 1994-2000 Wired Digital Inc., a Lycos Network site. All rights reserved.