Solved

Iframe taking up space :(

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
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…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

756 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