example.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>KityMinder Example</title>
  6. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" >
  7. <link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
  8. <link rel="stylesheet" href="src/kityminder.css" rel="stylesheet">
  9. <style type="text/css">
  10. body {
  11. margin: 0;
  12. padding: 0;
  13. height: 100%;
  14. }
  15. #minder-view {
  16. position: absolute;
  17. border: 1px solid #ccc;
  18. left: 10px;
  19. top: 10px;
  20. bottom: 10px;
  21. right: 10px;
  22. }
  23. </style>
  24. <script type="text/javascript" src="node_modules/kity/dist/kity.min.js"></script>
  25. </head>
  26. <body>
  27. <script id="minder-view" type="application/kityminder" minder-data-type="json">
  28. {
  29. "root": {
  30. "data": {
  31. "text": "百度产品",
  32. "image": "https://www.baidu.com/img/bd_logo1.png?where=super",
  33. "imageSize": { "width": 270, "height": 129 }
  34. },
  35. "children": [
  36. { "data": { "text": "新闻" } },
  37. { "data": { "text": "网页", "priority": 1 } },
  38. { "data": { "text": "贴吧", "priority": 2 } },
  39. { "data": { "text": "知道", "priority": 2 } },
  40. { "data": { "text": "音乐", "priority": 3 } },
  41. { "data": { "text": "图片", "priority": 3 } },
  42. { "data": { "text": "视频", "priority": 3 } },
  43. { "data": { "text": "地图", "priority": 3 } },
  44. { "data": { "text": "百科", "priority": 3 } },
  45. { "data": { "text": "更多", "hyperlink": "http://www.baidu.com/more" } }
  46. ]
  47. }
  48. }
  49. </script>
  50. </body>
  51. <script type="text/javascript" src="dist/kityminder.core.min.js"></script>
  52. <script type="text/javascript">
  53. // 创建 km 实例
  54. /* global kityminder */
  55. var km = window.km = new kityminder.Minder();
  56. km.setup('#minder-view');
  57. km.disable();
  58. km.execCommand('hand');
  59. </script>
  60. </html>