【问题标题】:jQueryUI toggle in a dialog box [closed]对话框中的jQueryUI切换[关闭]
【发布时间】:2012-09-06 07:39:23
【问题描述】:

是否可以在对话框内添加切换窗口?对话框打开,单击链接内部将向下滑动表单。所以我有一个对话框

$('a.open_dialog').click(function() {
    $('<div />').appendTo('body').load($(this).attr('href')).dialog({
        title: $(this).attr('title'),
        modal: true,
        draggable: false,
        width: 800,
        position: 'top'            
    });
    return false;
});

我想在里面

$('a.mailer').click(function() {
    $('#contact-wrapper').show();
});

【问题讨论】:

    标签: jquery user-interface toggle dialog


    【解决方案1】:

    对于动态内容使用 jquery on():

    $('a.mailer').on('click',function() {
       $('#contact-wrapper').show();
    });
    

    【讨论】:

    • 从 jQuery 1.7 开始,.live() 方法已被弃用。使用.on() 附加事件处理程序。旧版本 jQuery 的用户应该使用.delegate() 而不是.live()
    • 示例:$(selector).live(events, data, handler); // jQuery 1.3+ $(document).delegate(selector, events, data, handler); // jQuery 1.4.3+ $(document).on(events, selector, data, handler); // jQuery 1.7+
    猜你喜欢
    • 2011-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多