Je cherche un script jQuery pour ouvrir une fenêtre au chargement d'une page, seulement dans certaines conditions, et ai déjà utilisé sur mon site le script suivant (qui lui ouvre une popup sur un clic) :
Code : Tout sélectionner
jQuery(function($)
{
$('a.POPCLICK').on('click', function()
{
var popID = $(this).data('rel');
var popWidth = $(this).data('width');
$('#' + popID).fadeIn().css({ 'width': popWidth}).prepend("<a href='#' class='close'><img src='Images/icone_fermer.png' class='BTN_fermer' /></a>");
var popMargTop = ($('#' + popID).height() + 80) / 2;
var popMargLeft = ($('#' + popID).width() + 80) / 2;
$('#' + popID).css({ 'margin-top':-popMargTop, 'margin-left':-popMargLeft });
$('body').append('<div id="FADE"></div>');
$('#FADE').css({'filter':'alpha(opacity=80)'}).fadeIn();
return false;
});
$('body').on('click', 'a.close, #FADE', function()
{
$('#FADE , .POPUP').fadeOut(function() { $('#FADE, a.close').remove(); });
return false;
});
});Quelqu'un pourrait-il m'aiguiller ?
Merci pour votre aide.