semtic - ui模态不起作用
Sementic-UI Modal is not working?
如何编写模态代码?我尝试作为语义文档,但我不能得到结果。
我包括:——
<link rel="stylesheet" type="text/css" href="css/semantic.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/modal.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/semantic.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/modal.min.js"></script>
<script type="text/javascript">
$('.ui.modal').modal('show');
});
</script>
下面是我的代码:-
<div class="ui modal">
<form class="ui form">
<div class="field">
<label>Old password</label>
<input type="text" name="oldpass" placeholder="old password">
</div>
<div class="field">
<label>Last Name</label>
<input type="text" name="newpass" placeholder="new password">
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" tabindex="0" class="hidden">
<label>I agree to the Terms and Conditions</label>
</div>
</div>
<button class="ui button" type="submit">Submit</button>
</form>
</div>
请给出一些想法。提前谢谢. .
你的代码有两个问题:
- 你试图在它在HTML中声明之前获得
.ui.modal
。您必须在关闭body
标记之前放置脚本标记,但在所有其他标记之后。或者你必须使用一些ready
事件。 你的代码有一个sintax错误。您必须在脚本末尾删除
});
。看一下下面的例子:
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/semantic.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/modal.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/semantic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.4/components/modal.min.js"></script>
<div class="ui modal">
<form class="ui form">
<div class="field">
<label>Old password</label>
<input type="text" name="oldpass" placeholder="old password">
</div>
<div class="field">
<label>Last Name</label>
<input type="text" name="newpass" placeholder="new password">
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" tabindex="0" class="hidden">
<label>I agree to the Terms and Conditions</label>
</div>
</div>
<button class="ui button" type="submit">Submit</button>
</form>
</div>
<script type="text/javascript">
$('.ui.modal').modal('show');
</script>
相关文章:
- 模态上的输入/注册字段不起作用
- Angular Js 尝试从主按钮回调动态更改模态文本并且不起作用
- 模态形式不;不起作用
- 使用Javascript在模态内部的标签上显示错误消息不起作用
- jBox模态对话框Created监听器函数从第二次开始就不起作用了
- Css 模态框 z 索引不起作用
- JQuery 在模态内不起作用
- 为什么此图像滑块在模态中不起作用
- 模态在IE9中不起作用 - 在打开开发人员工具时,它可以正常工作
- Javascript 在引导程序的模态窗口之外单击后不起作用
- 溢出-y 在模态内的 safari 中不起作用
- 角带 - 模态 HTML 转换不起作用
- Jquery 模态第二次不起作用
- NgAnimate - 由于 NGAnimate,我的模态显示隐藏不起作用
- 模态框功能齐全-les.links don'不起作用
- 角度模态>Ctrl+gt;服务>Ctrl继承不起作用
- 离子模态firstFocus不起作用
- 控制器上的模态在AngularJS上不起作用
- Laravel模态在blade的脚本中不起作用
- Angular UI Bootstrap Modal在eclipse中不起作用.模态弹出出现在页面的底部,而不是弹出