Advertisement
nicolaslagios

Full Screen Responsive iframe 2019

Apr 24th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.51 KB | None | 0 0
  1. <html lang="en" class="no-js">
  2.    <head>
  3.       <title>TITLE OF YOUR TARGET WEBSITE</title>
  4.       <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
  5.       <meta charset="utf-8">
  6.       <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7.       <style>
  8.       html body {width: 100%;height: 100%;padding: 0px;margin: 0px;overflow: hidden;font-family: arial;font-size: 10px;color: #6e6e6e;background-color: #000;} #preview-frame {width: 100%;background-color: #fff;}</style>
  9.       <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  10.       <script>
  11.          //function to fix height of iframe!
  12.          var calcHeight = function() {
  13.            //var headerDimensions = 0; //$('#header-bar').height();
  14.            $('#preview-frame').height($(window).height());
  15.          }
  16.          
  17.          $(document).ready(function() {
  18.            calcHeight();
  19.            /*$('#header-bar a.close').mouseover(function() {
  20.              $('#header-bar a.close').addClass('activated');
  21.            }).mouseout(function() {
  22.              $('#header-bar a.close').removeClass('activated');
  23.            });*/
  24.          });
  25.          
  26.          $(window).resize(function() {
  27.            calcHeight();
  28.          }).load(function() {
  29.            calcHeight();
  30.          });
  31.       </script>
  32.    </head>
  33.    <body>
  34.       <iframe id="preview-frame" src="//YOUR-TARGET-WEBSITE" name="preview-frame" frameborder="0" noresize="noresize" style="height: 902px;">
  35.       </iframe>
  36.    </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement