簡體   English   中英

點擊 Jquery 中的彈出按鈕后如何顯示刻度線?

[英]How to show the tick mark after clicking the popup button in Jquery?

在我的“條款和條件”彈出 window 中,我的要求是在關閉彈出窗口后顯示刻度線。 只有當我們單擊復選框時才會發生這種情況。 以下是我的條款和條件代碼,

HTML 主頁面:

 <div class="checkout-agreement">
    <input type="checkbox" class="required-entry">
    <label class="label">
        <button type="button" class="action action-show">
            <span>I agree the Terms Conditions</span>
        </button>
    </label>
</div>

彈出 window:

<div class="modal-inner-wrap">
    <header class="modal-header">

        <button class="action-close" data-role="closeBtn" type="button">
            <span>Close</span>
        </button>
    </header>
    <div class="modal-content">
        <div id="checkout-agreements-modal">
                <div>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
                </div>
        </div>
    </div>

    <footer class="modal-footer">

        <button class="action secondary action-hide-popup" type="button" "><span>Close</span></button>
            
        </footer>
        
    </div>

jQuery 代碼:

$('.checkout-agreement').modal({
    ...
    closed: function (){
       // Do some action when modal closed
    }
});

在此處輸入圖像描述 在此處輸入圖像描述 在此處輸入圖像描述 請給我建議以使這項工作。

 $(document).ready(function(){ $(document).on("click", ".action-close, .secondary", function(){ $(".termscondchbox").removeAttr("disabled"); $('.termscondchbox').prop('checked', true); }); $(document).on("click", ".termscondchbox", function(){ $(this).attr("disabled", true); $(this).prop('checked', false); }); });
 <script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script> <div class="checkout-agreement"> <input type="checkbox" class="required-entry termscondchbox" disabled="true"> <label class="label"> <button type="button" class="action action-show"> <span>I agree the Terms Conditions</span> </button> </label> </div> <div class="modal-inner-wrap"> <header class="modal-header"> <button class="action-close" data-role="closeBtn" type="button"> <span>Close</span> </button> </header> <div class="modal-content"> <div id="checkout-agreements-modal"> <div> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </div> </div> </div> <footer class="modal-footer"> <button class="action secondary action-hide-popup" type="button" "><span>Close</span></button> </footer> </div>

暫無
暫無

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

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