This code is working, but I was looking to get this simplified. I don’t know how to make this work in a very simple way. Looking forward for everyone’s help. Any idea is welcome.
jQuery("#state-of-the-art .fl-tabs-label").click(function() {
stateOftheArt();
});
jQuery("#everything-you-need .fl-tabs-label").click(function() {
everythingYouNeed();
});
jQuery("#monitor-your-sites .fl-tabs-label").click(function() {
monitorYourSites();
});
function stateOftheArt() {
jQuery("#state-of-the-art .fl-tabs-panel").addClass("tab-animation-fadeup");
setTimeout(function () {
jQuery("#state-of-the-art .fl-tabs-panel").removeClass("tab-animation-fadeup");
}, 400);
return
}
function everythingYouNeed() {
jQuery("#everything-you-need .fl-tabs-panel").addClass("tab-animation-fadeup");
setTimeout(function () {
jQuery("#everything-you-need .fl-tabs-panel").removeClass("tab-animation-fadeup");
}, 400);
return
}
function monitorYourSites() {
jQuery("#monitor-your-sites .fl-tabs-panel").addClass("tab-animation-fadeup");
setTimeout(function () {
jQuery("#monitor-your-sites .fl-tabs-panel").removeClass("tab-animation-fadeup");
}, 400);
return
}
2
Answers
Without having your html code, i can only guess but this could be a solution:
You can move the content of tabAnimation inside the click function.
Demo
Why dont you just create a function that give argument your html element.