Twitter Bootstrap Modal does not appear
Twitter Bootstrap Modal does not appear
我使用twitter引导程序创建的任何模式都不会出现。我不确定我做错了什么,因为我使用bootstrap提供的代码设置了一个测试模式,但它仍然不起作用。
这是我的代码(仅限正文):您需要链接到bootstrap.js、bootstrap-modal.js、jquery.js和bootstrap.css
<body>
<div class="modal hide" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
×
</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>
Modal body would go here...
</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
<a data-toggle="modal" href="#myModal">Show Modal</a>
</body>
以下是引导模式所需的引导包和jquery的链接:引导程序包jquery
我的问题是我同时包含了boostrap.js和bootstrap-modal.js。显然,如果你包含bootstrap.jsp,你就不应该也包含bootstrap-model.js,因为boostrap.jsp导入了它兼容的所有javascript插件。类似的东西。删除我的boostrap-modal.js脚本链接后,它就工作了。
您必须调用:
<script>
$('#myModal').modal('show')
</script>
在</body>
标签之后。或者,如果你只想在用户点击某个东西时调用它:
$('#button_id').click(function(){
$('#myModal').modal('show')
});
相关文章:
- jQuery is not loaded
- AngularJS JSON not arriving php
- $rootScope not working
- reactRedux is not defined
- jQuery document.ready not working
- Javascript/Jquery Blob not showing Chrome PDF
- ReferenceError: not defined
- ReferenceError: cordova is not defined @ng-cordova.min.js:7
- Javascript getElementsByTagName not working?
- jQuery's trim()的前缀为not运算符
- Javascript - element.childNodes does not see an append.newch
- SemanticUI模态not onDeny/onApprove事件未激发
- WebkitTransform not fluent
- JQuery.val( ) not working
- Tomcat websocket is not working
- :not选择器不适用于ul类-备选方案
- Javascript JSON.parse not working
- NodeJS Multer is not working
- React, Webpack: bundle.js is not generated
- Twitter Bootstrap Modal does not appear