• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

13. Positioning HTML Elements > 13.3. Controlling Positioning Via a DHTML JavaS...

Controlling Positioning Via a DHTML JavaScript Library

NN 4, IE 4

Problem

You want a reusable library of routines that ease the scripted positioning of elements in a page.

Solution

Use the DHTML library, DHTMLAPI.js (shown in Example 13-1 in the Discussion), to simplify cross-browser scripting of positionable elements. The library is compatible with IE 4 or later and Navigator 4 or later. It provides API routines for moving, hiding/showing, and modifying the stacking order of positioned elements. For example, you can move an absolute-positioned element whose ID is helpWindow to a location 300 pixels to the right and 200 pixels down from the top-left corner of the document with the following function call:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint