modal pop-up is not triggering

Hi guys,

Can you help me why my modal is not working? This was working fine before https://info.hollywoodbranded.com/testpurposeonly

$(document).ready(function(){
$(‘button.button-modal’).click(function(){
$(‘.modal-background’).css(“display”, “block”);
});
$(“.modal-close”).click(function(){
$(‘.modal-background’).css(“display”, “none”);
});
});

Hey @angelicsanoy I’m not seeing any HTML element with a class of “modal-background” in the source code of that page. I think the JS is working okay here from what I can see. I think the issue is the absence of the actual modal in that template. If you added in an HTML element with a class of “modal-background” it looks like the JS is working properly for it.

Hmmm.. it is added in the module

Here;s the full module code.

<div class="main_page">
 <div class="column_menu">
 {% inline_rich_text field="primary_menu" value="{{ module.primary_menu }}" %}
 <button class="button-modal" type="button"> 
 {% inline_text field="Test" value="{{ module.Test }}" %}
 </button>
 </div>
 <div class="card">
 <div class="card-image">
 {% if module.image_card.src %}
	<img src="{{ module.image_card.src }}" alt="{{ module.image_card.alt }}" width="{{ module.image_card.width }}" height="{{ module.image_card.height }}">
{% endif %}
 </div>
 <div class="card-icon">
 {% inline_rich_text field="Card" value="{{ module.Card }}" %
 </div>

</div>

<div class="modal-background">
 <div class="modal">
 <button class="modal-close">X</button>
 <div class="modal-content">
{% form
	form_to_use="{{ module.Form.form_id }}"
	response_response_type="{{ module.Form.response_type }}"
	response_message="{{ module.Form.message }}"
	response_redirect_id="{{ module.Form.redirect_id }}"
	response_redirect_url="{{module.Form.redirect_url}}"
	gotowebinar_webinar_key="{{ module.Form.gotowebinar_webinar_key }}"
%}
 </div>
 </div>

@angelicsanoy it looks like you might be missing a “}” after:

{% inline_rich_text field="Card" value="{{ module.Card }}" %

It should be this:

{% inline_rich_text field="Card" value="{{ module.Card }}" %}

Could you try adding that in and publishing your module afterwards to see if that helps?

Yayks. I’m so dumb. Thank u so much! :grinning_face_with_smiling_eyes:

@angelicsanoy no worries! Happens all the time. Happy to hear that worked!