如果我创建一个带有按钮的模态内联......我希望能够在单击每个按钮时执行某个操作。但是,我无法抓住模态中生成的这些按钮。
有谁知道我怎样才能抓住这些?
$('.open-popup-link').magnificPopup({
items: {
type: 'inline',
src: $('<div class="white-popup">\
<h4>Are you sure you were discharged for failing a drugs test?</h4>\
<p>You will not be able to change your answer once you have submitted these details.</p>\
<button id="test-popup-no">No, I\'ve made a mistake</button>\
<button id="test-popup-yes">Yes, I\'m sure</button>\
</div>')
},
type: 'inline',
midClick: true
});
当每个按钮被点击时,我想根据其 ID 执行不同的操作。
如果可以的话请帮忙。我一直在为此苦苦挣扎。只是做一个标准的 jQuery 选择似乎不起作用。
谢谢,迈克尔。