<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">详细信息</h4> </div> <div class="modal-body" id="nr">在这里添加一些文本</div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">确定</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal --> </div>
function JiaZai(bs) { var n = $("#fy_n").val(); bs=bs; $.ajax({ url:"ffffffchuli.php", data:{bs:bs,n:n, tp:1}, type:"POST", dataType:"JSON", success: function(data){ var strs = ""; for(var k in data) { strs=strs+"<div ><div style='background-image:url("+data[k].image+"); 314px; height:314px;overflow:hidden;background-position:center; float:left; margin-left:28px; margin-bottom:20px ;border-radius:12px ;'><div id='dise'></div> <div id='kkkk'><button class='btn btn-primary btn-lg xq' data-toggle='modal' data-target='#myModal' bs='"+data[k].code+"'>开始演示模态框</button><a style='color:#FFF'>|</a><a class='theng' href="guankan.php?bt='"+data[k].code+"'"><span class='glyphicon glyphicon-save'>可下载</span></a></div></div>" } $("#xian").html(strs);} }); $(".sc").click(function(){ alert("aa"); }) //查看详情 $(".xq").click(function(){ var code = $(this).attr("bs"); $.ajax({ url:"xqchuli.php", data:{code:code}, type:"POST", dataType:"TEXT", success: function(data){ var str ="<div>民族代>民族名</div>"; $("#nr").html(str); } }); })