您好我最近一直试图让模态与Semantic-UI一起工作但是我似乎无法按照我想要的方式工作。我想这样做,以便当用户点击侧栏上的特定菜单时,会在用户可以输入文本的页面上弹出一个模态。如果有人知道该怎么做,请在下面评论!感谢
<a class="item">
<i class="money icon"></i>
Free Coins
</a>
感谢任何可以提供帮助的人!
答案 0 :(得分:2)
将<a class="item">
更改为<a class="item" id="coins">
jquery的:
<script type="text/javascript">
$(document).ready(function(){
$('#coins').click(function(){
$('#modalid').modal('show');
});
});
</script>
注意: #modalid是你的模态div id。
希望这会奏效。
答案 1 :(得分:0)
$('#myModal')。modal('attach events','a.item','show');
答案 2 :(得分:0)
<div class="ui container">
//model start
<div class="ui basic modal">
<div class="ui icon header">
<i class="archive icon"></i>
Archive Old Messages
</div>
//content in model
<div class="content">
<p>Your inbox is getting full, would you like us to enable automatic archiving of old messages?</p>
</div>
//actions in the model(buttons)
<div class="actions">
<div class="ui red basic cancel inverted button">
<i class="remove icon"></i>
No
</div>
<div class="ui green ok inverted button">
<i class="checkmark icon"></i>
Yes
</div>
</div>
</div>
//model ends
//Button to click to pop up the model
<div class="ui button">
<i class="remove"></i>
delete
</div>
</div>
//script
<script>
$('.ui.button').click(function(){
$('.ui.basic.modal').modal('show');
});
</script>