Difference between revisions of "Mutually dependent line and gliders"

From JSXGraph Wiki
Jump to navigationJump to search
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();

Revision as of 10:11, 1 June 2012