我对语义 ui 模态有问题,当我单击订单时,我会显示模态,但模态无法正常工作。单击订单模式后,模式刚刚显示然后自行关闭。
查看代码
<div class = "ui form grid_6 omega">
<form target="paypal" method="post">
<div class="field1">
<div class="field">
<label>Nama</label>
<input placeholder="Nama" name="nama" type="text">
</div>
<div class="field">
<label>No. HP</label>
<input placeholder="No. HP" name="handphone" type="text">
</div>
<div class="field">
<label>Alamat</label>
<input placeholder="alamat" name="alamat" type="text">
</div>
<div class="field">
<label>Jumlah</label>
<div class="selectbox">
<select name="jumlah" id="">
<?php for ($i=1; $i <= 20; $i++): ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php endfor; ?>
</select>
</div>
</div>
<button type="submit" name="submit" class="ui teal button order-button">Order now</button>
</div>
</form>
</div>
<div id="modaldiv" class="ui small modal">
<i class="close icon"></i>
<div class="header">
Smalls Like Bakin
</div>
<div class="content">
<p>Thank you for your order</p>
</div>
<div class="actions">
<div class="ui positive right labeled icon button">
<a class="text-white" href="<?php echo site_url('home/order');?>">Back to Home</a>
<i class="checkmark icon"></i>
</div>
</div>
</div>
脚本模态
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" />
<script type="text/javascript" src = "<?php echo base_url(); ?>packaged/javascript/semantic.js" />
<script type = "text/javascript" >
$('.order-button').click(function () {
$('#modaldiv').modal('show');
});
</script>
你能帮我解决这个问题吗?谢谢你。