Bootstrap   发布时间:2022-04-18  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了twitter-bootstrap – Liferay中的Bootstrap模式大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用与Tomcat捆绑在一起的Bootstrap 2.3.2和Liferay 6.2.我在Bootstrap 2.3.2中创建了一些具有复杂主体结构的模态窗口,我想在我的门户中使用它们. Here据说Liferay使用Bootstrap 2.3.2 css,但不是Bootstrap 2.3.2 javascript和组件,如模态,工具提示,制表符……都包含在AlloyUI中.

包括Bootstrap 2.3.2 javascript并试图使用我的模态窗口,但如果我想显示模态窗口它不会出现.我想问一下,我怎样才能在Liferay中显示原生引导模态.

解决方法

你的模态没有出现的原因很可能是因为你的模态使用了hide CSS类,并且在Liferay 6.2中声明了以下CSS规则:
.aui .hide {
    display: none !important;
}

这会导致您的模态始终被隐藏.要解决这个问题,我建议避免使用hide类并添加style =“display:none;”对你的模态div这样:

<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <!-- Your modal HTML here... -->
</div>

以下是上述代码的可运行示例.如果您想在门户网站中使用它,只需删除< link>正在加载bootstrap CSS的元素(它被注释包围).

<!-- The following link is not necessary in Liferay Portal 6.2 since bootstrap is loaded automatically -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet"/>
<!-- The above link is not necessary in Liferay Portal 6.2. -->






<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.min.js"></script>
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h2 id="myModalLabel">Header Header Header</h2>
    </div>
    <div class="modal-body">
        <p>body body body</p>
    </div>
</div>
<button onclick="$('#myModal').modal();">Show</button>

大佬总结

以上是大佬教程为你收集整理的twitter-bootstrap – Liferay中的Bootstrap模式全部内容,希望文章能够帮你解决twitter-bootstrap – Liferay中的Bootstrap模式所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: