HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
iFrames, white space before image appears.
Goto page Previous  1, 2
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
DM



Joined: 27 Apr 2008
Posts: 12

PostPosted: Wed Apr 30, 2008 7:43 am     Reply with quote

Thanks.. Here's an example of a site that has the same type of look as I have developed:

www.bradholland.net

Thanks again.
Straystudio



Joined: 14 Apr 2008
Posts: 218
Location: Nord Italy

PostPosted: Wed Apr 30, 2008 7:54 am     Reply with quote

DM wrote:
but ... just made the iframe visible and bright green ... - The white space was still there ..

Aha ah! Which color the page background? We'll be coding accordingly: #000000 for black; #ffffff for white; #0000ff for blue; #555555 is a gray; and go on.

However, it seems not to be solving the problem, as long as the white spot still overrides the green.
I would be glad pulling a JavaTrick of mine out of my hat.

Surrond an IFRAME with such a DIV :

<div style="position: absolute; left: 316px; top: 103px; height: 350; width: 368;">
<div id="wait" style="display: none;">
<iframe src="images.html" name="images" width="368" height="350" scrolling="auto" frameborder="0" style="background-color:#000000;" allowtransparency+"true"></iframe>
</div>
</div>


Add in each command (the buttons calling the pictures) :

onClick='YourFunctionAlreadyPresent(); waiting();'


And place this in the HEAD of the document (right below the title tag, if it is there):

<script language="javascript">

function waiting() {
timer=setTimeout('document.getElementById("wait").style.display="none";',1);
timer=setTimeout('document.getElementById("wait").style.display="block";',
1000);
}

</script>

It applies a delay on the iframe to appear;
it will keep the iframe as hidden, how long as depending on the 1000 number; customize it, based on how long an images needs to fully upload:

1000 = 1 second
2000 = 2 second
  500 = an half second
  250 = 1/4 of a second

In this while, the images takes its time to upload; without beeing shown.

I am looking forward to hear, it does not move Your page layout.
Of course, You need to have Java/JavaScript enabled on the Browser;
if not, check under TOOLS / OPTIONS.
 
DM



Joined: 27 Apr 2008
Posts: 12

PostPosted: Wed Apr 30, 2008 2:41 pm     Reply with quote

Thanks Straystudio...but the position of the iframe moved, as you suspected.
And the white space problem remained.
Straystudio



Joined: 14 Apr 2008
Posts: 218
Location: Nord Italy

PostPosted: Wed Apr 30, 2008 5:34 pm     Reply with quote

DM wrote:
... the position of the iframe moved,

I forgot to say, coordinates style="position:absolute; left: 316px; top: 103px;" have to be removed away from the iframe tag; indeed, they are not there in my code above. I moved coordinates to the div only.
Otherwise, iframe does move twice !
Positioning is committed to the uppest div, which is steady (does not get timed reduction).

In place of, I left instead style="background-color:#000000;" setting iframe backgrond to black.

Be sure onClick Event really calls the function waiting();
check by setting the timer (the 2nd one in the script) from 1000 to 5000, so You should get a five seconds long delay the image to display; if it does quicker (as it must not), then it means something went wrong in typing.
Care of not to delete quotes and commas accidentally.

What are You linking to the images with? input button, text links, drop-down menù, ...
 
Straystudio



Joined: 14 Apr 2008
Posts: 218
Location: Nord Italy

PostPosted: Wed Apr 30, 2008 7:21 pm     IFRAME white flash on image resizing Reply with quote

 
Wait ...
I strongly suspect now, the fact has to do with image resizing, the Browser does to fit the image into iframe 's fixed space.

You handle pics having original size larger than width="368" height="350", I guess; as iframe space is sized in pixel.
If so, scroll bars should appear on a while, too.


As far as managing uploading time, the way I showed is more than good, but I no longer think this is the actual matter; as more, since You told images come from computer itself, they may upload almost instantly.
I kept thinking of a delay due to the system, due to very Mb-heavy images, to naming elements to be revised, and so; but at end, I am actually sure it is due to auto image resizing.

Check any image size, right-mouse click on the image, go to Properties and left click.

Let us know ...
Straystudio



Joined: 14 Apr 2008
Posts: 218
Location: Nord Italy

PostPosted: Wed Apr 30, 2008 8:09 pm     Reply with quote

Well, from the code You gave, <iframe src="images.html" I understand You embeded image in an html document; I second that as the right way to go, usually done by centering the img in a table.

If so, You could work out as file.html : (shortly)

<table height="100%" width="100%"><tr>
<td align="center" valign="middle">

<img height="" width="" src="file.jpg" />

</td></tr>
</table>

Now assign value in pixel to both height="" width=""
accordingly to the iframe size and of course, keeping picture's proportions.

Now I have to leave.
You have to assign both the height and the width as final ones, not one only. So, the iframe will find everything squared already.
You lose the capabilty to show those file.html full size image alone on to the Broser, yet.

Editing the whole set of pics in post-work, duplicated and resized, would be way better; working out iframe-wise dimensions directly as their original new size.
Do not forget to keep saved aside, original copies in original large size, as well.
You won't go back well, to one day, from a size-reduce pic to the large one again.
 
DM



Joined: 27 Apr 2008
Posts: 12

PostPosted: Sat May 03, 2008 12:24 am     Reply with quote

Hi Straystudio- Thanks. My images going into the iframe are all the same size as the iframe, 368x350 px. All of the images are jpg of varying sizes on a jif background that matches the background of the main page where the iframe is located. Below the code for an image:

<tr>
<td rowspan="5">
<img src="images/_art-copy2---Almo-30.gif" width="41" height="272" alt=""></td>
<td> <a href="Beware-What-You-Eat.html" target="images"><img src="images/_art-copy2---Almo-31.jpg" alt="" width="20" height="20" border="0"></a></td>
<td colspan="2" rowspan="5">
<img src="images/_art-copy2---Almo-32.gif" width="33" height="272" alt=""></td

Thanks for your time and effort.
DM



Joined: 27 Apr 2008
Posts: 12

PostPosted: Wed May 07, 2008 12:23 pm     White space in iFrame Reply with quote

I read that the white space that appears before the image in an iFrame is the space that the Browser is making available for the image. Can anyone verify that?

Thanks.
soccermatrix



Joined: 10 May 2008
Posts: 1

PostPosted: Sat May 10, 2008 1:00 am     response to original message Reply with quote

Am I the only here, or is everybody doing something harder than it needs to be. Here is the original post by user DM:
"Would greatly appreciate help with getting rid of white area in iFrame that appears before linked image loads in iFrame. Thanks in advance to anyone."

Now, why would you want to load images using iframes?. Let me see if I understand what you're trying to do... You want to click on a link that displays a different image in a section of your page. MMhh, let's see. If that was the case, then you shouldn't be using iframes. If rames is to load data that needs to be hosted at a specific location and you can't move it, plus you want to show it in a section of your page.

Anyway, if all you want is to show a different image when a link is click then use this.

<!--Large Image -->
<img id="largeImg" src="image1.jpg" width="320px" height="240px;">
<a href="javascript:void(0)" onclick="largeImg.src='image2.jpg'">image2</a>
<!-- END Large Image -->

There you go, let me know if this is a better solution. If it's not what you were looking for, then your original posting is not clear.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial