Trying to insert an AngularJS app into an IFrame, by default it only appears squashed and small.
With some tweaks it shows full with but not full height (even if height is set at 100%)
<head>
<title>My Ionic App HTML Webpage Title</title>
<style>
html,body{
height:100%;
}
</style>
</head>
<body style="margin:0px;padding:0px;overflow:hidden">
<iframe src="http://example.com/myapp/#/tab/chats" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe>
</body>
EDITED & WORKING
It was the CSS that I have placed in the head tags that sorted it
html,body{
height:100%;
}
I have a set of simple SVG files in a scrollable DIV. You may see a demo here: http://www.ron2.byethost16.com/docviewertest.html This SVG list can be scrolled without problems in all major desktop browsers including Chrome and in some mobile browsers (Edge Mobile, Firefox Mobile and Android browser). However, in Chrome Mobile there is a problem: when scrolling it fast, some content on some SVG images is cut off and is not displayed, after a bit scrolling it may reappear but other content may disappear and so on (see these screenshots: http://imgur.com/a/rxZnK).
My HTML page code follows:
<!doctype html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<title>Test</title>
<style type="text/css">
iframe {
width: 935px;
height: 1210px;
overflow:hidden;
}
</style>
</head>
<body>
<div style="overflow: auto; width: 100%; height: 100%;">
<iframe src="page1.svg"></iframe>
<iframe src="page2.svg"></iframe>
<iframe src="page3.svg"></iframe>
<iframe src="page4.svg"></iframe>
<iframe src="page5.svg"></iframe>
<iframe src="page6.svg"></iframe>
<iframe src="page7.svg"></iframe>
<iframe src="page8.svg"></iframe>
<iframe src="page9.svg"></iframe>
<iframe src="page10.svg"></iframe>
</div>
</body>
</html>
I suspect it is a bug in Chromium because I experience it not only in Chrome Mobile but in applications built with Crosswalk. Does anyone know how to overcome this problem or is it indeed a browser bug?
I'm trying to iframe this site http://interimincomemodel.com/reps/eugeny/fastsuccess/ into this one http://interimincomemodel.info/fastsuccess/
When I open index.htm on my PC with IE11 the iframe just looks like the original site.
But when I upload it on the server, the background is messed up in IE11: background image is not fit to screen, headlines are not highlighted, email boxes are not rounded.
Also when trying to iframe this website
interimincomemodel.com/reps/eugeny/
into
interimincomemodel.info
the video player controls bar in the iframe is much larger and the last button "play full screen" goes outwards and can't be clicked. It happens in every browser.
I'm using this code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Interim Income Model</title>
<style media="screen" type="text/css">
body {
margin: 0;
padding 0;
overflow:hidden
}
</style>
</head>
<body>
<iframe src="http://interimincomemodel.com/reps/eugeny/" style="border:0px #FFFFFF none;" name="myiFrame" scrolling="auto" frameborder="0" marginheight="9px" marginwidth="100%" height="100%" width="100%"></iframe>
</body>
</html>
What can be causing the issues?
Thanks
I have an iframe used as an index file to hide a url of next website.
<iframe style="position:absolute; top:0px; left:0px; " src=" http://..." width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
This all works in all known to me browsers instead of Internet Explorer (checked on 9). Is it a simple way to make it visible correctly?
First of all mixing html attributes with css is nasty thing.
Anyway this should work flawlessly if you are looking for fullscreen iframe:
CSS:
/* notice you actually don't need absoulte positioning */
body,html,iframe {
margin:0;
padding:0;
width: 100%;
height: 100%;
}
body,html {
overflow: hidden;
}
HTML:
<html>
// add head, css
<body>
<iframe src=""></iframe>
</body>
</html>
Unfortunately, not that I've found. Instead, you would need to use JavaScript to monitor window size.
Or just use a regular frame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Page title</title>
</head>
<frameset rows="*">
<frame src="http://..." />
</frameset>
</html>
I am trying to scroll an iframe on iOS, and I succeeded, it's scrolling well, reference:
http://home.jejaju.com/play/iframe-scroll.html
http://areaaperta.com/nicescroll/demo.html
BUT, all solutions have an issue: the iframe page is not completely displayed...
I tested on my iphone and ipad, the iframe page displays choppy.
any idea?
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9;FF=3;chrome=1;OtherUA=4" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.js"></script>
<script type="text/javascript">
$(function(){
if (/iPhone|iPod|iPad/.test(navigator.userAgent))
$('iframe').wrap(function(){
var $this = $(this);
return $('<div />').css({
width: $this.attr('width'),
height: $this.attr('height'),
overflow: 'scroll',
'-webkit-overflow-scrolling': 'touch'
});
});
})
</script>
<title>Untitled</title>
</head>
<body>
stuff
<div>
<iframe src="iframe-scroll-long.html" height="500" width="500"></iframe>
</div>
more stuff
</body>
</html>
This solution is a bit of a hack, but is tested and works fine on iOS:
<div style="width: 760px; height: 500px; overflow: scroll !important;-webkit-overflow-scrolling:touch !important;">
<object type="text/html" data="HTTP://YOURPAGE.URL" style="width:1000px; height:10000px;">
</object>
</div>
Basically, since scrolling works fine in a DIV, you embed your page code using the object tag. The problem is, due to the same origin policy, you can't determine your target page's dimensions. I found that setting a huge page size is perfectly workable (no delay or choppyness noticed...just blank space)
You can easily determine the client OS and only add this code to iOS devices.
I found a combination of div with "absolute" style and nicescroll do fix choppines.
You have to load nicescroll on the page loaded by iframe.
In the same page wrap all you content with a div (with style absolute)
#content { position:absolute; }
Load nicescroll using wrapped div content.
$(document).ready(function() {
$("html").niceScroll("#content");
});
Link to demo page, so you can check the code: http://areaaperta.com/nicescroll/demo/iframe6.html
Automatically, with iOS native scroll has used, in other platform you got nicescroll active.
I have test on iPad with iOS 5.1.
Try adding -webkit-transform:translate3d(0,0,0) to the iframe style and all elements within to force hardware acceleration - should reduce the choppiness.
In main page style:
iframe { -webkit-transform:translate3d(0,0,0); }
and in iframe style:
p { -webkit-transform:translate3d(0,0,0); }
I found this to be a problem with relatively positioned content inside the frame.
Get rid of this behavior when removing position: relative;