positionizer

Positionizer.setPosition

Positionizer.setPosition(element, position)

elementhtmlelement to position

positionobject {x,y}

<div id="el" style="border:solid 2px gray;min-width:200px;min-height:100px">Ref Element</div> <script> var el = document.querySelector("#el"); Positionizer.setPosition(el, { x: "150px", y: "200px" }); </script>

Positionizer.getPosition

Positionizer.getPosition(element)

elementhtmlelement to get position

{x,y} position of the element

Positionizer.setRelativePosition

Positionizer.setRelativePosition(refElement, floatingElement, placement, appendToBody, distX, distY)

refElementthe fixed element

floatingElementthe element to be placed in relation to the reference element

placement

            relative position
            like :
    
                bottom-right
                bottom-left
                bottom
                top-right
                right-bottom
                bottom-right
                left-bottom
                left-top
                top-left
                top-center
                right
                left
                right-top
                top-right-outside
                top-left-outside
                bottom-left-outside
                bottom-right-outside
                bottom-right-inside
                bottom-left-inside
                bottom-inside
                top-right-inside
                top-left-inside
                top-inside
                left-inside
                right-inside
        

appendToBodyboolean

distXhorizontal distance between the 2 elements, default is 0.

distYvertical distance between the 2 elements, default is 0.