点击“显示”按钮,我需要打开一个弹出框。我正在使用流星1.1.9。谁知道我怎么能用流星做到这一点?
答案 0 :(得分:0)
如果你想打开模态,这是一个简单的例子
<强>的test.html 强>
<div style="float:right; margin: 10px 40px;">
<input type="button" class="btn btn-info open-insert-modal" value="Data Insert" data-backdrop="false"></div>
<div id="insertModal" class="modal fade" style="margin-left: 25%;margin-top: 10%;width: 50%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">InsertData</h4>
</div>
<div class="modal-body">
<!-- body code -->
</div>
</div>
</div>
<强> test.js 强>
'click .open-insert-modal': function (e) {
e.preventDefault();
//{backdrop: "static"} it is use for only close button click than close
$('#insertModal').modal({backdrop: "static"});
},
答案 1 :(得分:0)
我的代码在下面 的的test.html 强>
<template name="modal">
<div style="float:right; margin: 10px 40px;">
<input type="button" class="btn btn-info open-insert-modal" value="Data Insert" data-backdrop="false">
</div>
<div id="insertModal" class="modal fade" style="margin-left:25%;margin-top: 10%;width: 50%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">InsertData</h4>
</div>
<div class="modal-body">
</div>
</div>
</div>
</template>
test.js
Template.body.events({
'click .open-insert-modal': function (e) {
e.preventDefault();
//{backdrop: "static"} it is use for only close button click than close
$('#insertModal').modal({backdrop: "static"});
},
});
这与Bipin发布的代码相同,我试图打开类似于jQuery弹出窗口的弹出窗口。