index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>amCharts Responsive Example</title>
  6. <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/start/jquery-ui.css"rel="stylesheet" />
  7. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  8. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  9. <style>
  10. .ui-resizable-helper {
  11. border: 1px dotted gray;
  12. }
  13. .resizable {
  14. display: block;
  15. width: 800px;
  16. height: 500px;
  17. padding: 0;
  18. border: 2px solid #ddd;
  19. overflow: hidden;
  20. position: relative;
  21. }
  22. iframe {
  23. width: 100%;
  24. height: 100%;
  25. }
  26. #controls {
  27. background: #ccc;
  28. opacity: 0.5;
  29. padding: 5px 8px;
  30. font-size: 14px;
  31. font-weight: bold;
  32. font-family: Verdana;
  33. margin-bottom: 10px;
  34. }
  35. #dims {
  36. background: #ddd;
  37. color: #555;
  38. padding: 5px 8px;
  39. font-size: 14px;
  40. font-family: Verdana;
  41. width: 100px;
  42. text-align: center;
  43. }
  44. .ui-resizable-se {
  45. display: none!important;
  46. }
  47. </style>
  48. <script>
  49. $(function () {
  50. $(".resizable").resizable({
  51. animate: true,
  52. animateEasing: 'swing',
  53. animateDuration: 250,
  54. resize: function( event, ui ) {
  55. $('#dims').html(ui.size.width+'x'+ui.size.height+'px');
  56. }
  57. });
  58. });
  59. function setType (type) {
  60. $('#iframe').attr('src', type);
  61. }
  62. function reload() {
  63. setType($('#type').val());
  64. }
  65. function resize( dim, dir) {
  66. var container = $('.resizable');
  67. if ( 'w' == dim )
  68. container.css({ 'width': container.width() + dir});
  69. else
  70. container.css({ 'height': container.height() + dir});
  71. $('#dims').html(container.width()+'x'+container.height()+'px');
  72. }
  73. </script>
  74. </head>
  75. <body>
  76. <div id="controls">
  77. <input type="button" value="w-" onclick="resize('w', -50);" />
  78. <input type="button" value="w+" onclick="resize('w', 50);" />
  79. <input type="button" value="h-" onclick="resize('h', -50);" />
  80. <input type="button" value="h+" onclick="resize('h', 50);" />
  81. <select id="type" onchange="setType(this.options[this.selectedIndex].value);">
  82. <option value="pie1.html" selected="selected">Pie #1 (Simple w/ legend)</option>
  83. <option value="pie2.html"/>Pie #2 (3D w/ legend)</option>
  84. <option value="pie3.html"/>Pie #3 (several instances)</option>
  85. <option value="serial1.html">Serial #1 (Area)</option>
  86. <option value="serial2.html">Serial #2 (Bar &amp; Line)</option>
  87. <option value="serial3.html">Serial #3 (Line w/ zoom)</option>
  88. <option value="xy.html">XY</option>
  89. <option value="radar.html">Radar</option>
  90. <option value="gauge.html">Gauge</option>
  91. <option value="funnel.html">Funnel</option>
  92. <option value="gantt.html">GANTT</option>
  93. <option value="stock.html">Stock</option>
  94. <option value="map.html">Map</option>
  95. </select>
  96. <input type="button" value="reload" onclick="reload();" />
  97. </div>
  98. <div id="dims">800x500px</div>
  99. <div class="resizable">
  100. <iframe id="iframe" src="pie1.html" sytle="border: none; width: 100%; height: 100%;" frameborder="0"></iframe>
  101. </div>
  102. </body>
  103. </html>