point events
drag points and mouse up
HTML
<link rel="stylesheet" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css">
<script src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<span id="out">output here</span>
<div id="jxgbox"></div>
CSS
#jxgbox {
width: 700px;
height: 700px;
}
JavaScript
var board = JXG.JSXGraph.initBoard('jxgbox', {
boundingbox: [-5, 5, 5, -5],
axis: false,
grid: false
}),
drag = function () {
$('#out').html(this.X());
},
up = function () {
$('#out').html('up ' + this.name);
};
a = board.create('point', [0, 1]);
b = board.create('point', [1, 1]);
c = board.create('point', [2, 2]);
//board.on('update', drag);
a.on('drag', drag);
a.on('up', up);
b.on('up', up);