makePositioned :: Element

makePositioned(element) -> HTMLElement

 

Allows for the easy creation of CSS containing block by setting an element's CSS position to 'relative' if its initial position is either 'static' or undefined. Returns element.

 

To revert back to element's original CSS position, use undoPositioned().

 

Example

 

Consider the following case:

 

<p>lorem […]</p>

<div id="container">

  <div id="element" style="position: absolute; top: 20px; left: 20px;"></div>

</div>

 

makepos_before

 

To position div#element relatively to it's parent element:

 

$('container').makePositioned();

// -> HTMLElement

 

makepos_after

 

See also

 

Element: undoPositioned

 


Prototype API 1.5.0 - prototypejs.org