| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>GeoGebra 几何画板</title>
- <script src="./deployggb.js"></script>
- <style>
- body {
- margin: 0;
- padding: 0;
- overflow: hidden;
- }
- #ggb-element {
- width: 100%;
- height: 100%;
- margin: 0;
- }
- </style>
- </head>
- <body>
- <div id="ggb-element"></div>
- <script>
- // 获取浏览器窗口尺寸(包含滚动条)
- const windowWidth = window.innerWidth;
- const windowHeight = window.innerHeight;
- // 获取文档根元素(html)尺寸
- const htmlWidth = document.documentElement.scrollWidth;
- const htmlHeight = document.documentElement.scrollHeight;
- // 获取body元素尺寸
- const bodyWidth = document.body.clientWidth;
- const bodyHeight = document.body.clientHeight;
- const clientWidth = document.documentElement.clientWidth
- const clientHeight = document.documentElement.clientHeight
- // 实时监听窗口尺寸变化
- window.addEventListener('resize', () => {
- console.log('新窗口尺寸:', window.innerWidth, window.innerHeight);
- });
- var params = {
- "appName": "graphing",
- "width": clientWidth,
- "height": clientHeight,
- "showToolBar": true,
- "showAlgebraInput": true,
- "showMenuBar": true
- };
- var applet = new GGBApplet(params, true);
- window.addEventListener("load", function () {
- applet.inject('ggb-element');
- });
- </script>
- </body>
- </html>
|