2012-09-06 55 views
0

可以在对话框中添加一个切换窗口吗?该对话框打开并单击链接内部将滑下窗体。所以我有对话框jQueryUI在对话框中切换

$('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(); 
}); 

回答

0

对于动态内容,使用上()jQuery的:

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

在jQuery 1.7 ** *的*,'.live()'方法已被弃用。使用'.on()'附加事件处理程序。老版本的jQuery用户应该使用'.delegate()'而不是'.live()'。 –

+1

实例: '$(选择器).live(事件,数据,处理程序);'// jQuery的1.3+ '$(文件).delegate(选择器,事件,数据,处理程序);'// jQuery的1.4。 3+ '$(document).on(events,selector,data,handler);'// jQuery 1.7+ –