I am looking for a CSS solution that will let me to display a few horizontal full-screen iframes in one page.
I can do the jQuery myself, I just need couple of iframes to be in one page so I can click 'next' and the next iframe will be full screen. (So the iframes should be floated)
Thanks!
You can add allowfullscreen attribute to the iframe so that you can click fullscreen button in the HTML5 player toolbar to go fullscreen.
given the iframe is directly under body. If the iframe has a parent between itself and the body, the iframe will still get the height of its parent. One must explicitly set the height of every parent to 100% as well (if that's what one wants).
iFrames let you embed external content, such as YouTube videos, advertisements, and content from other sites into your own web page. You can easily resize iFrames using HTML and/or CSS, and even make them resizable so they'll adjust automatically based on the user's screen size.
Use iframeclass on the iframes to make them appear on top of each other, then use jQuery to set the z-index to show which is "on top"
.iframeclass {
position: absolute;
top: 0; left: 0;
width:100%;
height:100%;
}
note: in order for height: 100%; to work, the PARENT object must have a height set. ie:
body {
height:100%;
}
Second note, please be aware that whilst this answers your question, its not how I'd recommend doing what I think you are trying to achieve, I'd recommend loading each frame's content into a single div with ajax as and when you need it. The iframes will ALL load their content on page load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With