摘要: 本文介绍基于GeoGebra和JavaScript的小程序样例 - 3D和2D多个模型同在一页。
网页代码:
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
| <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>3D和2D多个模型同在一页</title> <style type="text/css"> div[id^="applet"] { display: inline-block; } </style> </head> <body>
<div id="applet1"></div> <div id="applet2"></div>
<script src="../GeoGebra/deployggb.js"></script> <script> var applet1 = new GGBApplet({filename: '2d.ggb'}); var applet2 = new GGBApplet({filename: '3d.ggb'});
applet1.setHTML5Codebase('../GeoGebra/HTML5/5.0/web3d/', true); applet2.setHTML5Codebase('../GeoGebra/HTML5/5.0/web3d/', true);
window.onload = function() { applet1.inject('applet1', 'html5'); applet2.inject('applet2', 'html5'); }; </script> </body> </html>
|