Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.html 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. }
  61. .example-list h4:hover,.example-list ul li:hover{
  62. cursor: pointer;
  63. }
  64. .example-list ul{
  65. padding-left: 33px;
  66. list-style: none;
  67. }
  68. .example-list ul li{
  69. margin: 10px 0;
  70. font-size: 15px;
  71. }
  72. .example-list ul li:hover,.example-list ul li.active{
  73. color: #1e80ff;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div class="container">
  79. <div class="nav">
  80. <div class="banner"> DC-SDK v3.0.0 </div>
  81. <div class="example-list-wrapper">
  82. <div id="example-list" class="example-list" data-accordion-group> </div>
  83. </div>
  84. </div>
  85. <div class="example">
  86. <iframe id="inner-page" src="info/start.html" style="border: 0"></iframe>
  87. </div>
  88. <script src="./list.js"></script>
  89. <script type="text/javascript">
  90. $(document).ready(function() {
  91. let $currentPage = undefined
  92. EXAMPLE_LIST.forEach(item => {
  93. let $section = $('<div data-accordion ></div>')
  94. let $title = $('<h4 data-control ></h4>').text(item.name)
  95. $title.appendTo($section)
  96. let $pageWrapper= $('<ul data-content></ul>')
  97. $pageWrapper.appendTo($section)
  98. if(item.children){
  99. item.children.forEach(child => {
  100. let $page = $('<li>'+ child.name +'</li>')
  101. $page.bind('click',e=>{
  102. if($currentPage){
  103. $currentPage.removeClass('active')
  104. }
  105. $('#inner-page').attr('src',item.folder+'/'+child.page)
  106. $page.addClass('active')
  107. $currentPage =$page
  108. })
  109. $pageWrapper.append($page)
  110. })
  111. }
  112. $section.appendTo($('#example-list'))
  113. })
  114. $('#example-list [data-accordion]').accordion();
  115. });
  116. </script>
  117. </div>
  118. </body>
  119. </html>