已关闭。此问题需要更多focused。目前不接受回答。
**要改进此问题吗?**更新此问题,使其仅针对editing this post的一个问题。
29天前关闭
Improve this question的
这段代码是工作,但我希望得到这个简化。我不知道如何使这个工作在一个非常简单的方式。期待大家的帮助。任何想法都欢迎。
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条答案
按热度按时间gopyfrb31#
没有你的html代码,我只能猜测,但这可能是一个解决方案:
字符串
您可以在click函数中移动tabAnimation的内容。
Demo
x
的字符串
cqoc49vn2#
你可以创建一个函数,把你的html元素作为参数。
字符串