我在此处为以下选项卡添加了淡入淡出效果,但过渡并不顺畅,尤其是在最后 2 个选项卡上。
我希望它像这里的这个页面。
如果有人可以提供帮助,这是Javascipt:
$(window).load(function(){
$('.tab:not(.aboutus)').fadeOut();
$('.tabs li').click(function(){
var thisAd = $(this).parent().parent();
$(thisAd).children('.tab').fadeOut();
$(thisAd).children('.'+$(this).attr('class').replace('tab','')).fadeIn();
$('.tabs li').removeClass('active');
$(this).addClass('active');
});
newContent.hide();
currentContent.fadeOut(10, function() {
newContent.fadeIn(100);
currentContent.removeClass('current-content');
newContent.addClass('current-content');
});
if(window.location.hash) {
if (window.location.hash == "#map") {
$(".Advert").children('.tab').fadeOut();
$(".Advert").children('.map').fadeIn();
$('.tabs li').removeClass('active');
$('.maptab').addClass('active');
}
if (window.location.hash == "#voucher") {
$(".Advert").children('.tab').fadeOut();
$(".Advert").children('.vouchers').fadeIn();
}
}
});
非常感谢。