PDA

View Full Version : Appear/Disappear Problems



Clayf700
01-01-2011, 08:37 PM
you see, my problem is that i'm trying to make an object disappear without changing the "display:block or display:none" in css. because for some reason it screws up my alignments when i set my tables to 100% in width or height. sometimes it even screws up the height or width

here's the code that toggles from appearing to disappearing

function Appear(itemID){
// Toggle visibility between none and inline
if ((document.getElementById(itemID).style.display == 'none'))
{
document.getElementById(itemID).style.display = 'inline';
} else {
document.getElementById(itemID).style.display = 'none';
}
}

and then i use this also


onclick="Appear('Whatever');return false"

how would i toggle without using css?
Or At least do it in a different method?

Beverleyh
01-01-2011, 09:00 PM
Sorry I can't see your whole code via my blackberry to be able to offer something specific but try toggling "visibility:hidden" and "visibility:visible" instead as this just hides the element from view but the element still occupies the original space so nothing else will shift into it.

Clayf700
01-01-2011, 09:42 PM
You... Are... A... MIRACLE WORKER!
Thanks!