Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Iframe taking up space :(

Posted on 2009-04-11
3
Medium Priority
?
472 Views
Last Modified: 2012-05-06
Hi,
I have an invisible iframe on a page, but even though its invisible its taking up the space that it would take up when visible :(

I want it to be completly invisible and then when visible it should expand the page...
(code is below)
<html>
      <head>
            <meta  name="vs_targetSchema"  content="http://schemas.microsoft.com/intellisense/ie5">
            <script  id="clientEventHandlersJS"  language="javascript">
<!--
function ShowWebSite(val)
{
      document.all.myFrame.src=val;
      document.all.myFrame.style.visibility="visible";
}
 
function Button1_onclick() {
var v = document.all("txtWebSite").value;
ShowWebSite(v);
}
//-->
            </script>
      </head>
      <body>
            <iframe  id="myFrame"  frameborder="0"  vspace="0"  hspace="0"  marginwidth="0"  marginheight="0"
                  width="600"  scrolling="yes"  height="1000"  style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 999; LEFT: 20px; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid;  visibility:hidden;">
            </iframe>
            <form  id="form1">
                  Enter website:<input  type="text"  id="txtWebSite"  NAME="txtWebSite"  value="http://www.yahoo.com">
                  <input  type="button"  value="Show"  id="Button1"  name="Button1"  onclick="return Button1_onclick()">
            </form>
      </body>
</html>

Open in new window

0
Comment
Question by:jumanj1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 800 total points
ID: 24122505
jumanj1,

Instead of visibility: hidden you need to use display.  The value is none to hide it and inline to show it (or clear the value).  E.g.

display: none;
display: inline;

Visibility doesn't remove it from the page; just hides it.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:jumanj1
ID: 24122621
Exactly what i was looking for, thanks!
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 24122680
Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.
bol
0

Featured Post

Industry Leaders: 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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

719 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