0

http://madaxedesign.co.uk/

在我的主页上,我在页面底部创建了一个名为“get in touch”的锚点,它有一个 Contact-pop-up 类,并且在 Jquery 中添加了 a.contact-pop-up 到 Jquery所以 onClick 它将执行脚本,但是当我按下 get in touch 锚点进行测试时,它似乎不起作用。

我想知道是否有人知道为什么会这样?

jQuery

    $('a.contact , a.contact_footer , a.contact-pop-up').click(function() {
    $("#popup").load("contact.php");
    // Getting the variable's value from a link
    var 
    show = $('#popup').css('display', 'block'),
    popup = $(this).attr('href');

    //Fade in the Popup and add close button
    $(popup).fadeIn(300);

    //Set the center alignment padding + border
    var popMargTop = ($(popup).height() + 24) / 2; 
    var popMargLeft = ($(popup).width() + 24) / 2; 

    $(popup).css({ 
        'margin-top' : -popMargTop,
        'margin-left' : -popMargLeft
    });

    // Add the mask to body
    $('body').append('<div id="mask"></div>');
    $('#mask').fadeIn(300);

    return false;
});

// When clicking on the button close or the mask layer the popup closed
$('a.cross, #mask').live('click', function() { 
  $('#mask , #popup').fadeOut(300 , function() {
    $('#mask').remove();  
}); 
return false;
}); 

HTML:

   <p>Please take the time to look through my portfolio and if anything interests you or   have any questions, please 

保持联系。

谢谢

4

1 回答 1

1

可能你想要这样的东西......

HTML:

<div class="popup" id="someId">
    <p class="arch-pop-msg">Please take the time to look through my portfolio and if anything interests you or   have any questions, please</p>
</div>

JS:

$(".popup").dialog({ modal: true, 
                     position : 'center', 
                     width: 380, 
                     height: 90, 
                     autoOpen: false, 
                     closeOnEscape: true, 
                     resizable: false,  
                     showTitlebar: false  
                   });

CSS:根据需要添加 css

于 2013-04-22T15:57:45.243 回答