File: button.html

package info (click to toggle)
jsxgraph 1.3.5+dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 26,044 kB
  • sloc: xml: 5,869; java: 1,072; python: 747; php: 192; makefile: 146; sh: 47
file content (32 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
   <title>JSXGraph example</title>
   <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
   <script type="text/javascript" src="/javascript/prototype/prototype.js"></script>
   <script type="text/javascript" src="../src/loadjsxgraph.js"></script>
</head>
<body>
  <h2>Input example</h2>
  <div id="jxgbox" class="jxgbox" style="width:700px; height:500px;"></div>
  <div id="debug" style="display:none;"></div>
   <script type="text/javascript">
    /* <![CDATA[ */

        board = JXG.JSXGraph.initBoard('jxgbox', {originX: 50, originY: 250, unitX: 600, unitY: 200});
        b1axisx = board.create('axis', [[0,0], [1,0]], {});
        b1axisy = board.create('axis', [[0,0], [0,1]], {});

        var p = board.create('point', [0.5, 0.5], {id: 'p1'});

        var button1 = board.create('button', [0.1, 0.5, 'Change Y with JavaScript', function() {
            p.moveTo([p.X(), p.Y() + 0.1], 100);
        }], {});

        var button2 = board.create('button', [0.1, 0.25, 'Change Y with JessieCode',
            "$('p1').Y = $('p1').Y() - 0.1;"
        ], {});

  /* ]]> */
  </script>
</body>
</html>