Module-documentation

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

Draggable with handles

Draggable elements can have handles wher you can drag them. You set this up using the attribute dd-handle=="css-selector", or using javascript by using node.plugin(ITSA.Plugins.nodeDD, {handle: 'css-selector'}). The plugin does nothing more than add the right attribute to the draggable Element, and it just works.

Drag the 2 rectangles. The first is constrained using html, the second is set up using javascript.

drag me

drag me

Code-example:

<style type="text/css">
    .container:not(.dd-dragging) h1 {
        cursor: default;
    }
</style>
<body>
    <div class="container" plugin-dd="true" dd-handle="h1"><h1>drag me</h1></div>
    <div id="without" class="container"><h1>drag me</h1></div>
</body>
<script src="itsabuild-min.js"></script>
<script>
    document.getElement('#without').plug('dd', {handle: 'h1'});
</script>
API Docs