iframe.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>iframe jScrollPane demo</title>
  6. <!-- styles specific to demo site -->
  7. <link type="text/css" href="style/demo.css" rel="stylesheet" media="all" />
  8. <!-- styles needed by jScrollPane - include in your own sites -->
  9. <link type="text/css" href="style/jquery.jscrollpane.css" rel="stylesheet" media="all" />
  10. <style type="text/css" id="page-css">
  11. /* Styles specific to this particular page */
  12. iframe {
  13. width: 100%;
  14. height: 200px;
  15. border: 0;
  16. }
  17. </style>
  18. <!-- latest jQuery direct from google's CDN -->
  19. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  20. <!-- the mousewheel plugin -->
  21. <script type="text/javascript" src="script/jquery.mousewheel.js"></script>
  22. <!-- the jScrollPane script -->
  23. <script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script>
  24. <!-- scripts specific to this demo site -->
  25. <script type="text/javascript" src="script/demo.js"></script>
  26. <script type="text/javascript" id="sourcecode">
  27. // No page specific javascript - see the sourcecode of the loaded content instead
  28. </script>
  29. </head>
  30. <body>
  31. <div id="top-nav">
  32. <img src="image/logo.png" width="196" height="69" alt="jScrollPane">
  33. <ul>
  34. <li><a href="index.html">Home</a></li>
  35. <li><a href="index.html#examples">Examples</a></li>
  36. <li><a href="index.html#themes">Themes</a></li>
  37. <li><a href="index.html#usage">How to use</a></li>
  38. <li><a href="faqs.html">FAQs</a></li>
  39. <li><a href="known_issues.html">Known issues</a></li>
  40. <li><a href="index.html#support">Support</a></li>
  41. <li><a href="index.html#download">Download</a></li>
  42. </ul>
  43. </div>
  44. <div id="container">
  45. <h1>jScrollPane - example with iframes</h1>
  46. <p>
  47. This demonstration shows how you can apply jScrollPane to content in an iframe. Note that in this
  48. demo nothing is done in the hosting page (this one), all of the necessary javascript happens inside
  49. the loaded pages (e.g. <a href="iframe_content1.html">iframe_content1.html</a> and
  50. <a href="iframe_content2.html">iframe_content2.html</a>). Those pages basically use the same technique
  51. as in the <a href="fullpage_scroll.html">full page scroll</a> example.
  52. </p>
  53. <p>
  54. To implement this technique you don't need to add any code to the hosting page but you do need to have
  55. control over the pages which you load into the iframes. And each of those pages will need to include the
  56. relevant script files (e.g. jQuery, jScrollPane etc etc) as well as the document ready script as I show
  57. in my examples.
  58. </p>
  59. <h2>Vertical only</h2>
  60. <iframe src="iframe_content1.html"></iframe>
  61. <h2>Both</h2>
  62. <iframe src="iframe_content2.html"></iframe>
  63. <h2>Page javascript</h2>
  64. <div id="sourcecode-display">
  65. <p>The contents of this div will be replaced by the javascript added to this page</p>
  66. </div>
  67. <h2>Page CSS</h2>
  68. <div id="css-display">
  69. <p>The contents of this div will be replaced by the CSS added to this page</p>
  70. </div>
  71. </div>
  72. </body>
  73. </html>