如何弹出一个jquery,弹出文本

时间:2013-04-22 15:47:41

标签: jquery html css

http://madaxedesign.co.uk/

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

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

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 

取得联系。

谢谢

1 个答案:

答案 0 :(得分: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