var lequelsmall = "business"; $(function(){ $(".rond_tiers_small").click(function(){ on = $(this).data("on"); id = $(this).data("id"); if (on == "1") { $(this).data("on", "0"); $("#dynasmall"+id).show(); $("#secretsmall"+id).hide(); $("#pluscroix"+id).html("+"); } else { $(this).data("on", "1"); $("#dynasmall"+id).hide(); $("#secretsmall"+id).show(); $("#pluscroix"+id).html("×"); } }); $(".rect_concepts_small").click(function(){ delay = 500; offset_top = 50; level_unzoom = 0.85; shift_card = 70; $(".rect_concepts_small").each(function(index) { $(this).css("z-index", 20); $(this).css("top", "+"+offset_top+"px"); $(this).css("transform", "scale("+level_unzoom+")"); }); id = $(this).data("id"); $(this).css("z-index", 21); $(this).animate({"left": "0px"}, delay, "swing", function() {}); $(this).css("top", "0px"); $(this).css("transform", "scale(1.0)"); switch (id) { case "business": { $("#container_echange_small").animate({"left": "-"+shift_card+"px"}, delay, "swing", function() {}); $("#container_business_small").animate({"left": "0px"}, delay, "swing", function() {}); $("#container_ethique_small").animate({"left": "+"+shift_card+"px"}, delay, "swing", function() {}); break; } case "echange": { $("#container_ethique_small").animate({"left": "-"+shift_card+"px"}, delay, "swing", function() {}); $("#container_echange_small").animate({"left": "0px"}, delay, "swing", function() {}); $("#container_business_small").animate({"left": "+"+shift_card+"px"}, delay, "swing", function() {}); break; } case "ethique": { $("#container_business_small").animate({"left": "-"+shift_card+"px"}, delay, "swing", function() {}); $("#container_ethique_small").animate({"left": "0px"}, delay, "swing", function() {}); $("#container_echange_small").animate({"left": "+"+shift_card+"px"}, delay, "swing", function() {}); break; } } lequelsmall = id; }); });