I have a frame that includes a hidden <div> at first (before any action), the problem is that when opening the page, I have a white space, and i can't reduce the size of the frame because the content of the <div> will not appear!

how to hide the white space of the frame without reducing it's size?!?

Do you have a link by any chance? If the div is "hidden" I assume you mean no content, how it is taking up space? Maybe I don't understand the problem entirely...

when I open the page, I have a frame that contains a hidden div. After uploading a file the div will appear and contains the name of uploaded file.

My question is how to hide the white space when the div is hidden?

u know the frame has fixed height and width! if I reduce the width of the frame, then the content of the div will not appear!

Not too sure why you have punctuated those sentences when I had no idea of your requirements.

Anyway, you should look at the visibility or display attributes for the div (css, but it can easily be modified by JavaScript).

The frame is in fact an upload form, which should be displayed permanently, when user upload a file the file will appear in a box (this box is hidden if no file uploaded).

The problem is:

Even if the box is hidden, I should have space for it in the Frame otherwise it's content will not appear, so how to hide the white space of the box without decreasing the frame width?!

don't know if u got my idea :(

So originally the box should be "hidden" and take up no space, correct?

What I assume happens next is some kind of box is pressed to upload a file, and if this is so, you attach an even e.g. "onclick" to the button and change the css of the box at the same time.

Would this work for your scenario?

Yes, That's correct.

But the problem is not with the box! it is with the frame width. Actually if the box is hidden it doesn't take any space. Also, i should have frame size big enough to hold the box content (while not empty). That's why i have problem with white space in my page!

Maybe I can use an event, to increase the width of the frame on uploading a file??

You could probably increase the width of the frame, otherwise have some other content in the frame, or have a permanently hidden div to set the width.

Hopefully I am understanding you now :p

Are you ? :P

Anyway I will try to increase the frame width after upload !!

Test
<div style="visibility:hidden;display:none;">
You can't see me... <br />
And I don't take up any space...<br />
</div>
Test
<div style="visibility:hidden;display:inline;">
You can't see me...<br />
But I do take up space... <br />
</div>
Test
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.