12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /**
- * 说明:创建页面元素
- */
- function createHtml() {
- let sign =
- `<div id="all-controls">
- <div class="controls">
- <a id="horizontalExpansion" class="control-item">
- <i class="btn-horizontal"></i>
- <span class="tooltiptext">横向展开</span>
- </a>
- <a id="verticalExpansion" class="control-item">
- <i class="btn-vertical"></i>
- <span class="tooltiptext">纵向展开</span>
- </a>
- <a id="moveByFps" class="control-item">
- <i class="btn-fps"></i>
- <span class="tooltiptext">第一人称行走</span>
- </a>
- <a id="miniMap" class="control-item">
- <i class="btn-map"></i>
- <span class="tooltiptext">小地图</span>
- </a>
- <a id="sceneSetting" class="control-item">
- <i class="btn-setting"></i>
- <span class="tooltiptext">设置</span>
- <div class="control-menu map-bg-select-menu">
- <div class="control-menu-wrapper" style="position: relative">
- <div class="control-menu-pane">
- <ul class="setting-list">
- <li class="autoRotate setting-item selected">自动旋转</li>
- </ul>
- </div>
- </div>
- </div>
- </a>
-
- </div>
- </div>`;
- // 将页面元素加入到div2d容器中,相关示例可参考官方示例-->界面2D-->UIAnchor
- $('#div2d').append($(sign));
- registerEvent(); // 注册事件
- }
|