Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('a.poplight[href^=#]').click(function() {
- var popID = $(this).attr('rel'); //Trouver la pop-up correspondante
- var popURL = $(this).attr('href'); //Retrouver la largeur dans le href
- //Récupérer les variables depuis le lien
- var query= popURL.split('?');
- var dim= query[1].split('&');
- var popWidth = dim[0].split('=')[1]; //La première valeur du lien
- $('#' + popID).fadeIn().css({
- 'width': Number(popWidth)
- })
- .prepend('');
- var popMargTop = ($('#' + popID).height() + 80) / 2;
- var popMargLeft = ($('#' + popID).width() + 80) / 2;
- $('#' + popID).css({
- 'margin-top' : -popMargTop,
- 'margin-left' : -popMargLeft
- });
- $('body').append('');
- //Apparition du fond - .css({'filter' : 'alpha(opacity=80)'})
- $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn();
- return false;
- });
- $('a.close, #fade').live('click', function() { //Au clic sur le bouton ou sur le calque...
- $('#fade , .popup_block').fadeOut(function() {
- $('#fade, a.close').remove();
- });
- return false;
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement