The following works fine:
classes_tab.click(function(evt){
evt.preventDefault();
h_c.filter(':visible').fadeOut(fast, function(){
disactive.removeClass('active');
classes_tab.addClass('active');
classes.fadeIn(fast);
});
});
contacts_tab.click(function(evt){
evt.preventDefault(evt);
h_cl.filter(':visible').fadeOut(fast, function(){
disactive.removeClass('active');
contacts_tab.addClass('active');
contacts.fadeIn(fast);
});
});
home_tab.click(function(evt){
evt.preventDefault();
c_cl.filter(':visible').fadeOut(fast, function(){
disactive.removeClass('active');
home_tab.addClass('active');
home.fadeIn(fast);
});
});
Is there a way of writing a function before this click events without repeating every time what is happening inside the click event?
Say I have something like:
function tabs(x, y){
x.fadeOut(fast);
y.fadesIn(fast);
}
than inside each click event I just call this function by changing parameters