Solved

Iframe taking up space :(

Posted on 2009-04-11
3
463 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
  • 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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now