首页 > 解决方案 > 在 JQuery 中具有多组图像的 FadeIn 和 FadeOut 效果

问题描述

我想在我的网页中淡入/淡出一些图像,就像
http://jsfiddle.net/hKMFb/450/
但是有一些条件是:
1. 当我点击任何一个图像时,新的一组图像应该用淡入淡出效果替换所有图像(类似于“不是机器人”验证码)
2. 我想知道在我的后端点击了哪个图像
我该怎么做?

$(document).ready(function() {
var activeId = $(".active").each(function(){
    $("#content" + $(this).attr("id").replace("tab","")).show(1000);
    });

    $(".tabs a").click(function() {
        var $tabs =$(this).closest(".tabs"); 
        $("#content" +$tabs.attr("data-lastContent")).hide(1000);
        $(this).closest(".tabs").find(".active").removeClass("active");
        $(this).addClass("active");
        var id = $(this).closest("li").attr("id").replace("tab","");
        $tabs.attr("data-lastContent", id);
        $("#content" + id).show(1000);     
    });
});

标签: jqueryhtmlajaxfrontend

解决方案


推荐阅读