Пожалуйста, помогите мне получить реальный результат.Я пытался получить этот код JavaScript, но у меня не работает.Мои клиенты хотят, чтобы эта модель оставалась и не могла быть закрыта до тех пор, пока вы не подпишетесь, а после подписки она должна автоматически скрываться, пока не истечет срок действия вашего Cookis.
<script type="text/javascript">
$('#myForm').on('submit', function(e) {
e.preventDefault(); //stop submit
if ($('#myCheck').is(':checked')) {
//Check if checkbox is checked then show modal
$("#myModal .close").click()
}
});
$('#myModal').modal({
backdrop: 'static',
keyboard: false
})
</script>
<div class="modal fade" id="myModal" data-keyboard="false" data-backdrop="static" style="display: none">
<img data-src="{{ 'newsletter_bg_image.jpg' | asset_url }}" style="display: none;" />
<div id="popup_newsletter" class="block block-subscribe lazyload lazypreload" data-bg="{% if settings.newsletter_bg_image_use != blank %}{{ 'newsletter_bg_image.jpg' | asset_url }}{% endif %}">
{%- if settings.newsletter_form_action != blank -%}
{%- assign form_action = settings.newsletter_form_action -%}
{%- else -%}
{%- assign form_action = '#' -%}
{%- endif -%}
<form action="{{ form_action }}" method="post" target="_blank" name="mc-embedded-subscribe-form">
<div class="block-content">
{%- if settings.newsletter_logo_use != blank -%}
<img src="{{ 'newsletter_logo.png' | asset_url }}" alt="">
{%- endif -%}
<div class="block-title">
{%- if settings.language_enable -%}
<span class="lang1">{{ settings.newsletter_title | split: '|' | first }}</span>
<span class="lang2">{{ settings.newsletter_title | split: '|' | last }}</span>
{%- else -%}
{{ settings.newsletter_title | split: '|' | first }}
{%- endif -%}
</div>
<div class="content">
{%- if settings.language_enable -%}
<span class="lang1">{{ settings.newsletter_content | split: '|' | first }}</span>
<span class="lang2">{{ settings.newsletter_content | split: '|' | last }}</span>
{%- else -%}
{{ settings.newsletter_content | split: '|' | first }}
{%- endif -%}
</div>
<label class="subcriper_label">
<div class="input-box">
<input id="pc-email" type="email" required value="{% if customer %}{{ customer.email }}{% endif %}" name="EMAIL" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" class="input-group-field input-text" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}">
<form method="post" action="" data-toggle="modal" id="myForm">
<input type="submit" class="btn-button effect" name="subscribe" {% if settings.language_enable %}data-translate="general.newsletter_form.go"{% endif %} value="{{ 'general.newsletter_form.go' | t }}">
</form>
<input id="myCheck" type="checkbox" class="subcriper_label" required>
<span>Please check here to confirm that you are 18+</span>
</label>
</div>
</div>
</form>
</div>
</div>