handlewithbeer Posted December 12, 2005 Posted December 12, 2005 hopefully someone can assist me with this. trying to make it so that when one div in my html page is hidden, another one is visible. tried this function hideShow(first,second) { var div1 = document.getElementById(first).style; var div2 = document.getElementById(second).style; div1.display = div1.display? "block":""; div2.display = div2.display? "":"block"; } not sure how to proceed. any help greatly appreciated. thanks. Quote
HJB417 Posted December 14, 2005 Posted December 14, 2005 http://www.netlobo.com/div_hiding.html does that help? Quote
Gill Bates Posted September 28, 2006 Posted September 28, 2006 function toggle(id) { var div = document.getElementById(id); div.style.display = (div.style.display == "none") ? "inline-block" : "none"; // you could also try this... // div.style.visibility = (div.style.visibility == "hidden") ? "visible" : "hidden"; } function hideShow(first,second) { toggle(first); toggle(second); } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.