Built-in pop up newsletter is not showing on mobile

Highlighted
New Member
2 0 0

Quite a common issue, I've checked similar topics on here, but unfortunately, those are different themes and the provided code didn't help. 

What do I need to change to make the newsletter appear on mobile devices?

Thank you in advance 

 

{% if settings.display_popup_newsletter %}
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function() { //
var $modalParent = jQuery('div.newsletterwrapper'),
modalWindow = jQuery('#email-modal'),
emailModal = jQuery('#email-modal'),
modalPageURL = window.location.pathname;

modalWindow = modalWindow.html();
modalWindow = '<div id="email-modal">' + modalWindow + '</div>';
$modalParent.css({'position':'relative'});
jQuery('.wrapper #email-modal').remove();
$modalParent.append(modalWindow);

if (jQuery.cookie('emailSubcribeModal') != 'closed') {
openEmailModalWindow();
};

jQuery('#email-modal .btn.close').click(function(e) {
e.preventDefault();
closeEmailModalWindow();
});
jQuery('body').keydown(function(e) {
if( e.which == 27) {
closeEmailModalWindow();
jQuery('body').unbind('keydown');
}
});
jQuery('#mc_embed_signup form').submit(function() {
if (jQuery('#mc_embed_signup .email').val() != '') {
closeEmailModalWindow();
}
});

function closeEmailModalWindow () {
jQuery('#email-modal .modal-window').fadeOut(600, function() {
jQuery('#email-modal .modal-overlay').fadeOut(600, function() {
jQuery('#email-modal').hide();
jQuery.cookie('emailSubcribeModal', 'closed', {expires:1, path:'/'});
});
})
}
function openEmailModalWindow () {
jQuery('#email-modal').fadeIn(600, function() {
jQuery('#email-modal .modal-window').fadeIn(600);
});
}

});
// ]]
// ]]></script>
<div class="newsletterwrapper">
<div id="email-modal" style="display: none;">
<div class="modal-overlay"></div>
<div class="modal-window" style="display: none;">
<div class="window-window">
<a class="btn close" title="Close Window"></a>




<div class="window-content">
<div class="newsletter-title">
<h2 class="title">{{ settings.popup_newsletter_title }}</h2>
</div>
<p class="message">{{ settings.popup_newsletter_message }}</p>
<div id="mailchimp-email-subscibe">
<div id="mc_embed_signup">
{% include 'newsletter-form' %}
</div>
<span>{{ settings.form_note }}</span>
</div>
</div>

</div>
</div>
</div>
</div>
{% endif %}

0 Likes