Difference between revisions of "Adding events"

From JSXGraph Wiki
Jump to navigationJump to search
Line 5: Line 5:
 
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 myPoint = brd.create('point',[1,1], {size:5});
 
var myPoint = brd.create('point',[1,1], {size:5});
 
 
JXG.addEvent(myPoint.rendNode, 'mouseover',  
 
JXG.addEvent(myPoint.rendNode, 'mouseover',  
 
             function(){ document.getElementById('myOutput').innerHTML = "Point "+this.name;},  
 
             function(){ document.getElementById('myOutput').innerHTML = "Point "+this.name;},  
Line 15: Line 14:
  
 
var myPoint2 = brd.create('point',[-1,1], {size:5});
 
var myPoint2 = brd.create('point',[-1,1], {size:5});
 
 
JXG.addEvent(myPoint2.rendNode, 'mouseover',  
 
JXG.addEvent(myPoint2.rendNode, 'mouseover',  
 
             function(){ document.getElementById('myOutput').innerHTML = "Point "+this.name;},  
 
             function(){ document.getElementById('myOutput').innerHTML = "Point "+this.name;},  
Line 22: Line 20:
 
             function(){document.getElementById('myOutput').innerHTML = ' ';},  
 
             function(){document.getElementById('myOutput').innerHTML = ' ';},  
 
             myPoint2);
 
             myPoint2);
myPoint2.hasPoint = function(){return false; };
+
//myPoint2.hasPoint = function(){return false; };
  
 +
<source lang="html4strict">
 +
<p id="myOutput">&nbsp;</p>
 +
</source>
  
 +
<source lang="javascript">
 +
</source>
 
</jsxgraph>
 
</jsxgraph>
  
 
[[Category:Examples]]
 
[[Category:Examples]]

Revision as of 13:25, 28 July 2010