Solved

Browser zoom on contents of iframe

Posted on 2014-01-14
6
702 Views
Last Modified: 2016-09-14
Hey all.

We have a site where we are transitioning out of frames / frame sets and are using an iframe for now.

The iframe is contained in an HTML file that has a fixed width of 1024px. The iframe itself is X % of that 1024px.

When a user navigates to a page that is displayed within the iframe and they use the browser zoom (alt / cmd + +/-), contents of the iframe get larger and elements on the right side of the page become hidden. If the page was not inside a fixed width iframe then it would expand accordingly but they become hidden.

I've tried changing the width of the iframe in the parent page when zoomed but that doesn't' work properly.

Any ideas? I can post a mockup on jsfiddle is need be.

...
0
Comment
Question by:Webspeeder
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:fredvr666
ID: 39779424
Is ued it like this:
css:
#textiframe {
      position:absolute;
      margin:0px 0px 0px 0px;
      padding:0px;
      top:90px;
      height:457px;
      width:1024px;
      left:175px;
      z-index:2;      /* FF scrolling*/
}

Html:
<iframe id="textiframe" name="textiframe" allowtransparency="true" frameborder="0" marginheight="0" vspace="0" ></iframe>
0
 

Author Comment

by:Webspeeder
ID: 39779519
I don't know that I want to use absolute positioning on the iframe, what exactly does this do? Meaning, does the z-index allow it to "flow" with contents?

I sort of fixed the issue with expanding the "page container" on which the iframe is located. Problem is that when I expand it on zoom in, I can't get it back to normal on zoom out.
0
 
LVL 3

Expert Comment

by:fredvr666
ID: 39779645
index-x means:
element with greater stack order is always in front of an element with a lower stack order.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Webspeeder
ID: 39780187
I know what z-index means, but you put /* FF scrolling */ next it, what do you mean by that?
0
 
LVL 3

Accepted Solution

by:
fredvr666 earned 500 total points
ID: 39780461
The scrolling inside a iframe doesn't worked, but you can remove that
0
 

Expert Comment

by:Ankit Kamdar
ID: 41797726
After adding position: absolute, iframe gets hidden
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JavaScript Loan Calculator Error 3 34
CSS - Centering an image 2 22
Jquery driving me nuts... 14 27
Word Press Fixes to Google Speed Test Issues 2 16
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question