Mutually dependent line and gliders: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 13: | Line 13: | ||
var gl2 = board.create('glider', [1,0, el1], {name:'a'}); | var gl2 = board.create('glider', [1,0, el1], {name:'a'}); | ||
var line = board.create('line', [gl1, gl2]); | var line = board.create('line', [gl1, gl2]); | ||
gl1.draggable = function() { return true; }; | gl1.draggable = function() {console.log("X"); return true; }; | ||
gl2.draggable = function() { return true; }; | gl2.draggable = function() {console.log("Y"); return true; }; | ||
var offset = gl2.Y() - gl1.Y(); | var offset = gl2.Y() - gl1.Y(); |