Programatically “picking up” connections between elements in jsPlumb jQuery

January 3, 2015   ·   0 Comments

Screen Shot 2015-01-03 at 10.34.35 AM

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)
        })
        
        
    })
    
   
    
})

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
jQuery172

jQuery

Amazon

adsbygoogle

Recent Posts

Categories

Amazon