1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| // le lien declanchant l'affichage du menu
$("#menu a").hover(function() {
$(this).addClass("menu-active");
$("#tt-" + $(this).attr('id')).stop(true).fadeTo(300, 1);
}, function() {
$(this).removeClass("menu-active");
$("#tt-" + $(this).attr('id')).stop(true).fadeTo(200, 0, function() { $(this).hide(); });
});
// survol le menu
$(".tt-menu").hover(function() {
...
$(this).stop(true).show().fadeTo(300, 1);
}, function() {
...
$(this).stop(true).fadeTo(200, 0, function() { $(this).hide(); });
});
// ajouter un produit au panier d'achat
$("#form-add-cart").submit(function(e) {
$("#tt-cart").stop(true).fadeTo(300, 1); // afficher le menu
...
$.ajax({
...
});
// et c est là ou mon probleme se pose*****
setTimeout(function() {
$("#tt-cart").stop(true).fadeTo(200, 0, function() {
$(this).hide();
});
}, 3000);
}); |
Partager