Solved

Iframe taking up space :(

Posted on 2009-04-11
3
470 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 200 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

617 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