|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <script src="./jquery.min.js"></script>
- <script src="./jquery.accordion.js"></script>
- <style>
-
- * {
- margin: 0;
- padding: 0;
- }
- html,
- body {
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- .container{
- display: flex;
- height: 100%;
- }
- .nav{
- width: 300px;
- height: 100%;
- overflow: hidden;
- background: #222;
- color: #fff;
- }
- .example{
- flex: 1;
- height: 100%;
- overflow: hidden;
- }
-
- iframe{
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
-
- .nav .banner{
- padding: 20px 20px 0 20px;
- color:#1e80ff;
- font-weight: bold;
- font-style: italic;
- }
- .example-list-wrapper{
- overflow: hidden;
- overflow-y: auto;
- user-select: none;
- margin-top: 15px;
- }
-
- .example-list h4{
- padding-left: 20px;
- padding-top: 20px;
- margin: 10px 0;
- border-top: 1px solid #444 ;
- }
-
- .example-list h4:hover,.example-list ul li:hover{
- cursor: pointer;
- }
-
- .example-list ul{
- padding-left: 33px;
- list-style: none;
- }
-
- .example-list ul li{
- margin: 10px 0;
- font-size: 15px;
- }
-
- .example-list ul li:hover,.example-list ul li.active{
- color: #1e80ff;
- }
-
-
-
-
- </style>
- </head>
- <body>
-
- <div class="container">
- <div class="nav">
- <div class="banner"> DC-SDK v3.0.0 </div>
- <div class="example-list-wrapper">
- <div id="example-list" class="example-list" data-accordion-group> </div>
- </div>
- </div>
- <div class="example">
- <iframe id="inner-page" src="info/start.html" style="border: 0"></iframe>
- </div>
-
- <script src="./list.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- let $currentPage = undefined
- EXAMPLE_LIST.forEach(item => {
- let $section = $('<div data-accordion ></div>')
- let $title = $('<h4 data-control ></h4>').text(item.name)
- $title.appendTo($section)
- let $pageWrapper= $('<ul data-content></ul>')
- $pageWrapper.appendTo($section)
- if(item.children){
- item.children.forEach(child => {
- let $page = $('<li>'+ child.name +'</li>')
- $page.bind('click',e=>{
- if($currentPage){
- $currentPage.removeClass('active')
- }
- $('#inner-page').attr('src',item.folder+'/'+child.page)
- $page.addClass('active')
- $currentPage =$page
- })
- $pageWrapper.append($page)
- })
- }
- $section.appendTo($('#example-list'))
-
- })
- $('#example-list [data-accordion]').accordion();
- });
- </script>
- </div>
- </body>
- </html>
|