選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.html 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>Document</title>
  9. <script src="./jquery.min.js"></script>
  10. <script src="./jquery.accordion.js"></script>
  11. <style>
  12. * {
  13. margin: 0;
  14. padding: 0;
  15. }
  16. html,
  17. body {
  18. width: 100%;
  19. height: 100%;
  20. overflow: hidden;
  21. }
  22. .container{
  23. display: flex;
  24. height: 100%;
  25. }
  26. .nav{
  27. width: 300px;
  28. height: 100%;
  29. overflow: hidden;
  30. background: #222;
  31. color: #fff;
  32. }
  33. .example{
  34. flex: 1;
  35. height: 100%;
  36. overflow: hidden;
  37. }
  38. iframe{
  39. width: 100%;
  40. height: 100%;
  41. overflow: hidden;
  42. }
  43. .nav .banner{
  44. padding: 20px 20px 0 20px;
  45. color:#1e80ff;
  46. font-weight: bold;
  47. font-style: italic;
  48. }
  49. .example-list-wrapper{
  50. overflow: hidden;
  51. overflow-y: auto;
  52. user-select: none;
  53. margin-top: 15px;
  54. }
  55. .example-list h4{
  56. padding-left: 20px;
  57. padding-top: 20px;
  58. margin: 10px 0;
  59. border-top: 1px solid #444 ;
  60. color: #bcbcbc;
  61. }
  62. .example-list h4:hover,.example-list ul li:hover{
  63. cursor: pointer;
  64. }
  65. .example-list ul{
  66. padding-left: 33px;
  67. list-style: none;
  68. }
  69. .example-list ul li{
  70. margin: 10px 0;
  71. font-size: 15px;
  72. }
  73. .example-list ul li:hover a,.example-list ul li.active a{
  74. color: #1e80ff;
  75. }
  76. .example-list ul li:hover,.example-list ul li a{
  77. color: #fff;
  78. text-decoration: none;
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div class="container">
  84. <div class="nav">
  85. <div class="banner"> DC-SDK v3.0.0 </div>
  86. <div class="example-list-wrapper">
  87. <div id="example-list" class="example-list" data-accordion-group> </div>
  88. </div>
  89. </div>
  90. <div class="example">
  91. <iframe id="inner-page" name="inner-page" style="border: 0" allow="fullscreen; xr-spatial-tracking;"></iframe>
  92. </div>
  93. <script src="./list.js"></script>
  94. <script type="text/javascript">
  95. $(document).ready(function() {
  96. let href =undefined
  97. let $currentPage = undefined
  98. if(window.location.href.indexOf("#")> -1){
  99. let hrefArr = window.location.href.split('#')
  100. if(hrefArr[1]){
  101. href = hrefArr[1].replace('_','/')
  102. }
  103. }
  104. $('#inner-page').attr('src',href || 'info/start.html')
  105. EXAMPLE_LIST.forEach(item => {
  106. let $section = $('<div data-accordion ></div>')
  107. let $title = $('<h4 data-control ></h4>').text(item.name)
  108. $title.appendTo($section)
  109. let $pageWrapper= $('<ul data-content></ul>')
  110. $pageWrapper.appendTo($section)
  111. if(item.children){
  112. item.children.forEach(child => {
  113. let $page = $('<li></li>')
  114. let $link = $('<a></a>').text(child.name)
  115. $link.attr('href',item.folder+'/'+child.page).attr('target','inner-page')
  116. $link.bind('click',e=>{
  117. if($currentPage){
  118. $currentPage.removeClass('active')
  119. }
  120. window.location.href = window.location.href.replace(/#\w*\.?\w*/g,'') +'#'+ item.folder+ '_'+child.page
  121. $page.addClass('active')
  122. $currentPage =$page
  123. })
  124. $page.append($link)
  125. $pageWrapper.append($page)
  126. })
  127. }
  128. $section.appendTo($('#example-list'))
  129. })
  130. $('#example-list [data-accordion]').accordion();
  131. });
  132. </script>
  133. </div>
  134. </body>
  135. </html>