繁体   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