我该如何关闭模态?

时间:2017-07-02 08:42:38

标签: php jquery magento

<div class="modal">
    <label for="modal-sizing">
        <a class="modal-trigger" id="modal-trigger"><span class="icon-rulers icon"></span>Size Guide
         <input class="modal-state" id="modal-sizing" type="checkbox">
        </a>
    </label>
    <input class="modal-state" id="modal-sizing" type="checkbox">
    <div class="modal-fade-screen" id="modal-fade-screen">
        <div class="modal-inner">
            <div class="modal-close" for="modal-sizing"><span class="icon-cross-circle icon-l"></span></div>
            <div class="modal-content"><img class="center" src="<?php echo $skinUrl?>images/size-chart-wide.png" width="1077" height="644" alt="Size Chart Wide"></div>
        </div>
    </div>
</div>
<script>
jQuery('.modal-trigger').click(function() {
    jQuery("input:checkbox").prop('checked', true);
});
</script>

1 个答案:

答案 0 :(得分:1)

尝试以下代码

jQuery('.modal-close').click(function () {
   jQuery('.modal').hide();
   jQuery('input:checkbox').prop('checked', false);
});