Screen Shot 2015-01-03 at 10.34.35 AM
source code is here

$(function() {

    
    jsPlumb.ready(function() {
       var jsp = jsPlumb.getInstance();
        jsp.draggable($("#start"));
        jsp.draggable($("#end"));
        
        var endpoint = jsp.addEndpoint($("#start"), {
            isSource:true
        });
        
        jsp.addEndpoint($("#end"), {
            isTarget:true
        }); 
        
        $("#dragbutton").bind("mousedown", function(e) {
            
            $(document).bind("mousemove.adjust", function(e) {
                
                var left = e.offsetX;
                var top = e.offsetY;
                $(endpoint.canvas).css({"left":left, "top":top});
                $(document).unbind("mousemove.adjust");
            });
            
            $(endpoint.canvas).trigger(e)
        })
        
        
    })
    
   
    
})

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is www.looptek.com

Leave a Reply