Difference between revisions of "Adding events"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) (New page: <jsxgraph width="400" height="400"> var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4], keepaspectratio:true}); var point = brd.create('point',[1,1], {size:5}); </jsxgraph>) |
A WASSERMANN (talk | contribs) |
||
Line 1: | Line 1: | ||
+ | <html> | ||
+ | <p id="myOutput"></p> | ||
+ | </html> | ||
<jsxgraph width="400" height="400"> | <jsxgraph width="400" height="400"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4], keepaspectratio:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-4,4,4,-4], keepaspectratio:true}); | ||
− | var | + | var myPoint = brd.create('point',[1,1], {size:5}); |
+ | |||
+ | JXG.addEvent(myPoint.rendNode, 'mouseover', | ||
+ | function(){ document.getElementById('myOutput').innerHTML = "Point "+this.name;}, | ||
+ | myPoint); | ||
+ | JXG.addEvent(myPoint.rendNode, 'mouseout', | ||
+ | function(){document.getElementById('myOutput').innerHTML =}, | ||
+ | myPoint); | ||
+ | point.hasPoint = function(){return false; }; | ||
+ | |||
</jsxgraph> | </jsxgraph> | ||
+ | |||
+ | [[Category:Examples]] |
Revision as of 13:23, 28 July 2010