Last active
October 7, 2024 23:27
-
-
Save leowebguy/a16c66f98fe8f1daa0ba to your computer and use it in GitHub Desktop.
Responsive iframe full screen. Display page without and hide original url address.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<style> | |
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> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
//function to fix height of iframe! | |
var calcHeight = function() { | |
//var headerDimensions = 0; //$('#header-bar').height(); | |
$('#preview-frame').height($(window).height()); | |
} | |
$(document).ready(function() { | |
calcHeight(); | |
/*$('#header-bar a.close').mouseover(function() { | |
$('#header-bar a.close').addClass('activated'); | |
}).mouseout(function() { | |
$('#header-bar a.close').removeClass('activated'); | |
});*/ | |
}); | |
$(window).resize(function() { | |
calcHeight(); | |
}).load(function() { | |
calcHeight(); | |
}); | |
</script> | |
</head> | |
<body> | |
<iframe id="preview-frame" src="https://oatweb1.myshopify.com/" name="preview-frame" frameborder="0" noresize="noresize" style="height: 902px;"> | |
</iframe> | |
</body> | |
</html> |
Thank you!
@leowebguy GG! Flawless victory! Thanks!
This works great, thanks, but I'm using it in WP and have a scrolling header with a sticky menu. This makes the entire header sticky. Any solutions?
Thank you so mcuh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/17710039/full-page-iframe/17714422#17714422