Module-documentation

version 1.0.0
module: vdom
maintanance: Marco Asbreuk
home
all modules

Positioning element

This example moves a div-node to a new location

Clik on the buttons to move the div:

Code-example:

<body>
    <div id="btncontainer">
        <button id="button-move">Move the div</button>
    </div>

    <div class="container"></div>
</body>
<script src="itsabuild-min.js"></script>
<script>
    var container = document.getElement('.container'),
        move1, move2;

    move1 = function() {
        container.setXY(525, 250);
    };

    move2 = function() {
        container.left = 200;
        container.top = 600;
    };

    ITSA.Event.after('tap', move1, '#button-move1');
    ITSA.Event.after('tap', move2, '#button-move2');

</script>
API Docs