Difference between revisions of "Dependent gliders"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||
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() { | ||
− | B.position = A.position - 0.5; | + | if (brd.highlightedObjects['A']!=null) { |
− | + | B.position = A.position - 0.5; | |
− | }, ' | + | B.prepareUpdate().update(true).updateRenderer(); |
+ | } | ||
+ | }, 'mousemove'); | ||
</jsxgraph> | </jsxgraph> |