Adding events 2: Difference between revisions

From JSXGraph Wiki
(Created page with "Please note: This only works when the SVG or VML renderer is used. With the Canvas renderer the rendNode property is undefined. <html> <p id="myOutput"> </p> </html> <jsxgra...")
 
No edit summary
Line 1: Line 1:
Please note: This only works when the SVG or VML renderer is used. With the Canvas renderer the rendNode property is undefined.
<html>
<html>
<p id="myOutput">&nbsp;</p>
<p id="myOutput">&nbsp;</p>

Revision as of 07:10, 29 March 2012

 

<p id="myOutput">&nbsp;</p>
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4], keepaspectratio:true});
var myPoint = brd.create('point',[1,1], {size:5, fixed: true});
myPoint.on('over', function(){
    document.getElementById('myOutput').innerHTML = "Point "+this.name;
});
myPoint.on('out', function(){
    document.getElementById('myOutput').innerHTML = '&nbsp;';
});

var myPoint2 = brd.create('point',[-1,1], {size:5});
myPoint2.on('over', function(){
    document.getElementById('myOutput').innerHTML = "Point "+this.name;
});
myPoint2.on('out', function(){
    document.getElementById('myOutput').innerHTML = '&nbsp;';
});