[jQuery] .onclick - Executing a function before another - Help Solve
Need the closeAll() function to execute before the div's slidedown.
All divs are initially hidden, just making a check that if one is
open, it must close before any new div runs.
Can someone help point me in the right direction?
Here is what I have so far.
function closeAll() {
$(".div1").slideUp('slow');
$(".div2").slideUp('slow');
$(".div3").slideUp('slow');
}
$(document).ready(function() {
$(".button1").click(function() {
closeAll();
$(".div1").slideDown('slow');
});
$(".button2").click(function() {
closeAll();
$(".div2").slideDown('slow');
});
$(".button3").click(function() {
closeAll();
$(".div3").slideDown('slow');
});
});
Thanks in advance