PageRenderTime 56ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 0ms

/public/assets/bigbox/plugins/fancytree-master/demo/sample-iframe.html

https://bitbucket.org/mad3linux/bigbox
HTML | 133 lines | 119 code | 8 blank | 6 comment | 0 complexity | e3af20c29f32084b11542fc8456ab4c5 MD5 | raw file
Possible License(s): GPL-2.0, MIT, Apache-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  5. <title>Fancytree - Example</title>
  6. <script src="../lib/jquery.js"></script>
  7. <script src="../lib/jquery-ui.custom.js"></script>
  8. <link href="../src/skin-win8/ui.fancytree.css" rel="stylesheet">
  9. <script src="../src/jquery.fancytree.js"></script>
  10. <!-- Start_Exclude: This block is not part of the sample code -->
  11. <link href="../lib/prettify.css" rel="stylesheet">
  12. <script src="../lib/prettify.js"></script>
  13. <link href="sample.css" rel="stylesheet">
  14. <script src="sample.js"></script>
  15. <!-- End_Exclude -->
  16. <style type="text/css">
  17. #tree {
  18. vertical-align: top;
  19. width: 250px;
  20. }
  21. iframe {
  22. border: 1px dotted gray;
  23. }
  24. </style>
  25. <!-- Add code to initialize the tree when the document is loaded: -->
  26. <script type="text/javascript">
  27. $(function(){
  28. // Attach the dynatree widget to an existing <div id="tree"> element
  29. // and pass the tree options as an argument to the dynatree() function:
  30. $("#tree").fancytree({
  31. // autoCollapse: true,
  32. minExpandLevel: 1,
  33. postinit: function(isReloading, isError) {
  34. this.reactivate();
  35. },
  36. focus: function(event, data) {
  37. // Auto-activate focused node after 2 seconds
  38. data.node.scheduleAction("activate", 2000);
  39. },
  40. activate: function(event, data) {
  41. var node = data.node;
  42. // Use <a> href and target attributes to load the content:
  43. if( node.data.href ){
  44. // Open target
  45. window.open(node.data.href, node.data.target);
  46. // or open target in iframe
  47. // $("[name=contentFrame]").attr("src", node.data.href);
  48. }
  49. }
  50. });
  51. });
  52. </script>
  53. </head>
  54. <body class="example">
  55. <h1>Example: URL navigation and iframes</h1>
  56. <p class="description">
  57. Use Fancytree as a navigation menu.
  58. <br>
  59. The tree initialization uses <code>&lt;a href='URL', target='TARGET'>title&lt;/a></code>
  60. tags.<br>
  61. The <code>activate</code> handler then uses <code>node.data.href</code>
  62. to open the the pages in the embedded iframe.<br>
  63. Note that the navigation will fallback to standard HTML links,
  64. when JavaScript is disabled.<br>
  65. A focused node will automatically be activated after 2 seconds (use the
  66. keyboard to try this out).<br>
  67. <br>
  68. The <kbd>Toggle tree</kbd> button in the embedded welcome page also gives
  69. an example on how to access a tree that exists outside the own frame.
  70. </p>
  71. <div>
  72. <label for="skinswitcher">Skin:</label> <select id="skinswitcher"></select>
  73. </div>
  74. <table>
  75. <colgroup>
  76. <col width="300px" valign="top">
  77. <col width="90%">
  78. </colgroup>
  79. <tr>
  80. <td valign="top">
  81. <!-- Add a <div> element where the tree should appear: -->
  82. <div id="tree">
  83. <ul>
  84. <li class="expanded folder">Search engines
  85. <ul>
  86. <li><a href="//duckduckgo.com" target="contentFrame">DuckDuckGo</a>
  87. <li><a href="//duckduckgo.com" target="_self">DuckDuckGo (target='_self')</a>
  88. <li><a href="http://duckduckgo.com" target="_top" title="This link replaces the current page">DuckDuckGo (target='_top')</a>
  89. <li><a href="//www.bing.com" target="contentFrame">Bing</a>
  90. <li><a href="//www.wolframalpha.com/" target="contentFrame">WolframAlpha</a>
  91. </ul>
  92. <li class="expanded folder">jQuery
  93. <ul>
  94. <li><a href="//www.jquery.com/" target="contentFrame">jQuery</a>
  95. <li><a href="//ui.jquery.com/" target="contentFrame">jQuery UI</a>
  96. <li><a href="//api.jquery.com/" target="contentFrame">API browser</a>
  97. <li><a href="//wwwendt.de/tech/fancytree/doc/jsdoc/index.html" target="contentFrame">Fancytree</a>
  98. </ul>
  99. <li class="expanded folder">Misc
  100. <ul>
  101. <li><a href="sample-iframe-1.html" target="contentFrame">Welcome</a>
  102. </ul>
  103. </ul>
  104. </div>
  105. </td>
  106. <td>
  107. <iframe src="sample-iframe-1.html" name="contentFrame" width="100%" height="500"
  108. scrolling="yes" marginheight="0" marginwidth="0" frameborder="0">
  109. <p>Your browser does not support iframes</p>
  110. </iframe>
  111. </td>
  112. </tr>
  113. </table>
  114. <!-- Start_Exclude: This block is not part of the sample code -->
  115. <hr>
  116. <p class="sample-links no_code">
  117. <a class="hideInsideFS" href="https://github.com/mar10/fancytree/">Fancytree project home</a>
  118. <a class="hideOutsideFS" href="#">Link to this page</a>
  119. <a class="hideInsideFS" href="index.html">Example Browser</a>
  120. <a href="#" id="codeExample">View source code</a>
  121. </p>
  122. <pre id="sourceCode" class="prettyprint" style="display:none"></pre>
  123. <!-- End_Exclude -->
  124. </body>
  125. </html>