[英]I can't input text into my form that is inside a jQuery UI accordion
就像標題說的那樣,我在jQuery UI Accordion內容div中有一個帶有單個輸入和按鈕的表單,並且在測試時無法在其中鍵入任何文本。 我也不能單擊按鈕。
這是HTML:
<button type="button" id="ic-open-report"><i class="fa fa-envelope"></i><p>Export Savings Report</p></buttOn>
<div id="ic-savings-report">
<h4>Export a PDF Savings Report</h4>
<div>
<form method="POST" class="savings-report">
<input style="user-select: text;" type="email" id="ic-email" placeholder="Email">
<button type="submit" >Export</button>
</form>
</div>
</div>
這是jQuery:
$('#ic-savings-report').accordion({
collapsible: true,
active: false,
animate: 400
});
$('#ic-savings-report').hide();
$('#ic-open-report').click(function(){
$('#ic-savings-report').toggle(700);
setTimeout("$( '#ic-savings-report' ).accordion( 'option', 'active', 0 );", 1000);
});
我什至不知道為什么會這樣。 為什么我將無法編輯輸入?
這是實際項目的鏈接: http : //lcstuff.000webhostapp.com/intellifrost-calculator/
只要您正確引用JQuery和JQuery UI,似乎就可以正常工作:
$('#ic-savings-report').accordion({ collapsible: true, active: false, animate: 400 }); $('#ic-savings-report').hide(); $('#ic-open-report').click(function () { $('#ic-savings-report').toggle(700); setTimeout("$( '#ic-savings-report' ).accordion( 'option', 'active', 0 );", 1000); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script> <button type="button" id="ic-open-report"> <i class="fa fa-envelope"></i> <p>Export Savings Report</p> </button> <div id="ic-savings-report"> <h4>Export a PDF Savings Report</h4> <div> <form method="POST" class="savings-report"> <input style="user-select: text;" type="email" id="ic-email" placeholder="Email"> <button type="submit">Export</button> </form> </div> </div>
我遇到了這個問題,jQuery ui設置了font-size: 1em
此元素.ui-widget input
上的font-size: 1em
,由於某種原因,這使文本不可見。 因此,給人的感覺是我無法輸入任何文字,因為鍵入時沒有文字顯示。
我只是將其設置為以下內容以對其進行修復:
font-size: 14px;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.