Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Bus Management System</title>
  6. <!-- Viewport meta tag to prevent iPhone from scaling our page -->
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  8.  
  9.  
  10. <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  11. <script>
  12.  
  13. $(function(){
  14.  
  15. var iFrames = $('iframe');
  16.  
  17. function iResize() {
  18.  
  19. for (var i = 0, j = iFrames.length; i < j; i++) {
  20. iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
  21. }
  22.  
  23. if ($.browser.safari || $.browser.opera) {
  24.  
  25. iFrames.load(function(){
  26. setTimeout(iResize, 0);
  27. });
  28.  
  29. for (var i = 0, j = iFrames.length; i < j; i++) {
  30. var iSource = iFrames[i].src;
  31. iFrames[i].src = '';
  32. iFrames[i].src = iSource;
  33. }
  34.  
  35. } else {
  36. iFrames.load(function() {
  37. this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
  38. });
  39. }
  40.  
  41. });
  42. </script>
  43.  
  44.  
  45. </head>
  46.  
  47. <style type="text/css" media="all">
  48. html, body, iframe {width:100%; height:100%;box-sizing:border-box; margin:0; padding:0; border:0;}
  49. body {border:4px solid green;}
  50. iframe {border:6px solid red;width:100%; height:100%;display:block;}
  51. #wrapper {border:2px solid blue; width:100%; height:100%;}
  52.  
  53. </style>
  54. <body>
  55. <div style="height:50px; background-color:#000; color:#fff;">Header</div>
  56.  
  57. <iframe src="http://www.google.com" style="width:100%; height:100%;" onLoad="calcHeight();"></iframe>
  58.  
  59. </body>
  60. </html>
  61.  
  62. <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  63. <script>
  64.  
  65. $(function(){
  66.  
  67. var iFrames = $('iframe');
  68.  
  69. function iResize() {
  70.  
  71. for (var i = 0, j = iFrames.length; i < j; i++) {
  72. iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
  73. }
  74.  
  75. if ($.browser.safari || $.browser.opera) {
  76.  
  77. iFrames.load(function(){
  78. setTimeout(iResize, 0);
  79. });
  80.  
  81. for (var i = 0, j = iFrames.length; i < j; i++) {
  82. var iSource = iFrames[i].src;
  83. iFrames[i].src = '';
  84. iFrames[i].src = iSource;
  85. }
  86.  
  87. } else {
  88. iFrames.load(function() {
  89. this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
  90. });
  91. }
  92.  
  93. });
  94. </script>
  95.  
  96. <iframe src="http://www.google.com" class="iframe" scrolling="no" frameborder="0"></iframe>
  97.  
  98. <div class="container">
  99. <div class="h_iframe">
  100. <iframe src="//www.youtube.com/embed/9KunP3sZyI0" frameborder="0" allowfullscreen></iframe>
  101. </div>
  102. </div>
  103.  
  104. html,body {
  105. height:100%;
  106. }
  107. .h_iframe iframe {
  108. position:absolute;
  109. top:0;
  110. left:0;
  111. width:100%;
  112. height:100%;
  113. }
  114.  
  115. html,body {height:100%;}
  116. .h_iframe iframe {width:100%; height:100%;}
  117. .h_iframe {
  118. height: 100%;
  119. }
  120.  
  121. width: calc(100% - 70px);
  122.  
  123. html,body {
  124. height:100%;
  125. margin-top:0;
  126. margin-bottom:0;
  127. }
  128. .h_iframe iframe {
  129. width:100%;
  130. height:calc(100% - 75px);
  131. }
  132. .h_iframe {
  133. height: 100%;
  134. }
  135. .element{
  136. width:100%;
  137. height:70px;
  138. background:red;
  139. }
  140.  
  141. <div class="container">
  142. <div class="element">here it goes</div>
  143. <div class="h_iframe">
  144. <iframe src="//www.youtube.com/embed/9KunP3sZyI0" frameborder="0" allowfullscreen></iframe>
  145. </div>
  146. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement