簡體   English   中英

Bootstrap 模態框在 AEM 中消失

[英]Bootstrap modal box is disappearing in AEM

這是我用於引導模式的 html 代碼。 它在我的本地瀏覽器中按預期工作,但是當我在 AEM 中運行時,模式框會出現一秒鍾然后消失。 我在 stackoveflow 上閱讀了很多答案,但沒有一個適用於 AEM。 有沒有其他人遇到過這個問題?

 <div class="wrapper"> <button type="button" id="modalButton" class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="javascript: return false;" > Click me </button> </div> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <div class="modal-body"></div> </div> </div> </div>

我解決了這個問題,數據切換不起作用

在此處添加了打開的 function:

<a type="button" id="modalButton" class="btn btn-primary" data-target="#myModal"  onclick="showmodal ();" >
            Click me
        </a>

並且在這里關閉 function:

<button type="button" class="close" onclick="hidemodal ()">&times;</button>

Added these two within the script tag


function showmodal () {
            $("#myModal").show();
        }
        function hidemodal () {
            $("#myModal").hide();
        }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM