Afficher et masquer un div avec jquery

Fermé
gintoxic Messages postés 524 Date d'inscription mardi 31 juillet 2007 Statut Membre Dernière intervention 7 avril 2016 - Modifié par gintoxic le 5/10/2013 à 20:21
gintoxic Messages postés 524 Date d'inscription mardi 31 juillet 2007 Statut Membre Dernière intervention 7 avril 2016 - 6 oct. 2013 à 16:42
bonjour
je voudrais réinitialiser la position et la taille d'une div mais pas moyen d'y arriver est ce que vous pourriez me dire ce qui ne va pas dans mon code svp ?

$(document).ready(function(){
$('#contact').addClass('contact');

$('#contact-index h3').click(function(){
$('.contact').animate({'width': '600px',
'height': '400px',
'background': 'rgba(255, 144, 11, 1) !important',
'position':'absolute',
'left' :'-250px',
'margin-left':'-300px',
'z-index':'50',
'top': '-600px'},
800)
.queue(function(){
$('#form_contact, #close_contact').css('visibility', 'visible')
.dequeue();
});


});
$('#close_contact').css('cursor','pointer');
$('#close_contact').click(function(){
$('.contact').animate({'width': '160px',
'height':'83px',
'position':'relative',
'left':'250px',
'margin-left':'300px',
'z-index':'5',
'top':'600px'},
800)
.queue(function(){
$('#form_contact, #close_contact').css('visibility', 'hidden')
.dequeue();
});
});
});

merci par avance

Si Dieu a créé l'homme, qui a créé Dieu, l'homme non ?
A voir également:

1 réponse

gintoxic Messages postés 524 Date d'inscription mardi 31 juillet 2007 Statut Membre Dernière intervention 7 avril 2016 10
6 oct. 2013 à 16:42
j'ai réussi à faire faire le sens inverse au bloc, mais il ne se passe aucune itération ; le bloc s'affiche et disparait une seule fois par effet..... pourriez vous m'aider svp pour que je trouve le moyen que l'affichage se passe à l'infini ?


mon code
$(document).ready(function(){
$('#contact').addClass('contact');

function afficheFormContact(){

$('.bloc_contact').animate({'cursor':'pointer',
'width': '600px',
'height': '400px',
'background': 'rgba(255, 144, 11, 1) !important',
'position':'absolute',
'left' :'-250px',
'margin-left':'-300px',
'z-index':'50',
'top': '-600px'},
800)
.queue(function(){
$('#form_contact, #close_contact').css('visibility', 'visible')
.dequeue();
});


}
function cacheFormContact(){
$('#form_contact, #close_contact').css('visibility', 'hidden');
$('.bloc_contact').css({'width': '160px',
'height':'83px',
'position':'relative',
'margin-top':'20px',
'left':'300px',
'top':'0'},
800);
}


$('#contact-index h3').click(function(){
afficheFormContact();
});
$('#close_contact').click(function(){
cacheFormContact();
});


});

merci par avance
0