...

View Full Version : DIV emptying in JS



sir pannels
09-07-2006, 02:02 PM
Hi,

Trying to empty a div using javacrript. I saw trying, I have yet not got much.
I tried setting the div to hidden, this works to some exstent but has a problem...

When the div is full, the page expands, when I hide the div the page is still expanded with a big blank gap, I need to empty the div so the page goes back to normal size.

Any one know how to do this using js? or have any links etc?

Many thanks
Sir P

name _F1
09-07-2006, 02:46 PM
visibility: hidden will simply hide the content, but it will still take up space on the page. Use display: none if you do not wish the DIV to take up space.

sir pannels
09-07-2006, 03:35 PM
Thanks downstrike, been looking for that for a while.

I have a question thogh, if NONE gets ride of it.. what displays it again? I tried show, true and run-in but none worked..


any idea?

sir pannels
09-07-2006, 03:39 PM
I just did it, be putting 'blank' into the style :)

Kor
09-07-2006, 03:39 PM
mydivobject.style.display='none';//hides
mydivobject.style.display='';//shows



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum