嗨,在我的脚本中,我使用了 Bootstrap 模式。问题是我在一段时间内接受它 - 功能。模态的第一个链接效果很好......打开模态和所有......但不是第二个,第三个......在那里我可以点击链接并且没有任何反应......有人知道吗?
<?php while($row = mysql_fetch_array($data)){?>
<td><a href="#<?php echo $row['id']; ?>" class="glyphicons no-js file_export" id="modal_ajax_demo_btn_<?php echo $row['id']; ?>" data-toggle="modal" title="Testversand"><i></i></a></td>
<div id="ajax-modal-<?php echo $row['id']; ?>" class="modal hide fade" tabindex="-1"></div>
<script type="text/javascript">
var UIModals = function () {
var initModals = function () {
$.fn.modalmanager.defaults.resize = true;
$.fn.modalmanager.defaults.spinner = '<div class="loading-spinner fade" style="width: 200px; margin-left: -100px;"><img src="assets/img/ajax-modal-loading.gif" align="middle"> <span style="font-weight:300; color: #eee; font-size: 18px; font-family:Open Sans;"> Ladevorgang...</div>';
var $modal = $('#ajax-modal-<?php echo $row['id']; ?>');
$('#modal_ajax_demo_btn_<?php echo $row['id']; ?>').on('click', function(){
// create the backdrop and wait for next modal to be triggered
$('body').modalmanager('loading');
user_id = $(this).attr('href').replace(/^#/,'');
setTimeout(function(){
$modal.load('send1.de', '', function(){
$modal.modal();
});
}, 1000);
});
$modal.on('click', '.update', function(){
$modal.modal('loading');
setTimeout(function(){
$.ajax({
type: "POST",
url: "send.php",
data: "id=" + user_id + "&email=" + $("#email").val(),
success: function(msg)
{
$modal
.modal('loading')
.find('.modal-body')
.prepend('<div class="alert alert-success fade in">' +
'All good!<button type="button" class="close" data-dismiss="alert"></button>' +
'</div>');
}
});return false;
}, 5000);
});
}
return {
init: function () {
initModals();
}
};
}();
</script>
</tr>
<?php } ?>