Dependent gliders: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 8: | Line 8: | ||
var C = brd.create('glider', [ 3,-1,li]); | var C = brd.create('glider', [ 3,-1,li]); | ||
brd.addHook(function() { | brd.addHook(function() { | ||
if (brd. | if (brd.drag==A) { | ||
B.position = A.position - 0.5; | B.position = A.position - 0.5; | ||
B.prepareUpdate().update(true).updateRenderer(); | B.prepareUpdate().update(true).updateRenderer(); |