mardi 21 avril 2015

I want to put an if else statement in this code to achieve a slide tab effect

Hi so I'm trying to create a tablike effect that swings a div out and fades in a div, the problem is i want multiple divs that can appear but always have the div that slides out hidden if that makes sense

heres what i got so far:

$('a.ask').click(function(){
       setTimeout(function() { $('#assk').fadeIn(400); }, 1000);
       $('.infoo').fadeOut(400);
       $('#content').addClass('align');
   });  
$('a.nav').click(function(){
       setTimeout(function() { $('.infoo').fadeIn(400); }, 1000);
       $('#assk').fadeOut(800);
       $('#content').addClass('align');
 });

now i want the .content to always be slided out when I click on either nav or ask, but I also want the div to slide back in once you reclick the triggers. Is there a way to do this? thank you for any and all help!

I know about toggleclass but it doesnt work because it toggles it back in when I want it out of the way, so I was thinking an if/else statement could help but I was stumped on it!!

Aucun commentaire:

Enregistrer un commentaire