The page I'm working on has links that animate open divs onclick. Here's the script:
function showSlidingDiv1(){
$("#slide1").animate({"height": "toggle"}, { duration: 1000 });}
And it works fine. The problem I have is that I have 3 other divs (#slide2, #slide3, #slide4) that need to display:none when the function is run.
I tried adding
document.getElementById('slide2').style.display = 'none';
document.getElementById('slide3').style.display = 'none';
document.getElementById('slide4').style.display = 'none';
to the function, but to no avail. I feel like this should be easy. Anybody got any ideas?