Modal on load

3 replies·opened Dec 6, 2017
N
nikoslavsDec 6, 2017

Hello,
can we set responsive classes on Modal on Load, i.e., need to sex width on different devices?

Also, is there option to dismiss modal on click?

URL www.allegrakrstarenja.com

N
nikoslavsDec 10, 2017

Any updates?

S
SemiColonWebSTAFFDec 10, 2017

Hello,

  1. This can be best achieved by using a Custom Class on the Modal Content:
<div class="modal1 mfp-hide" id="myModal1">
	<div class="block custom-modal-width divcenter" style="background-color: #FFF;">
		<div class="center" style="padding: 50px;">
			<h3>A Simple Example of a Text Modal</h3>
			<p class="nobottommargin">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum delectus, tenetur obcaecati porro! Expedita nostrum tempora quia provident perspiciatis inventore, autem eaque, quod explicabo, ipsum, facilis aliquid! Sapiente, possimus quo!</p>
		</div>
		<div class="section center nomargin" style="padding: 30px;">
			<a href="#" class="button" onClick="$.magnificPopup.close();return false;">Close this Modal</a>
		</div>
	</div>
</div>

and then use the following CSS Code:

.device-lg .custom-modal-width { max-width: 500px; }

.device-md .custom-modal-width { max-width: 400px; }

.device-sm .custom-modal-width { max-width: 300px; }

.device-xs .custom-modal-width { max-width: 200px; }

.device-xxs .custom-modal-width { max-width: 150px; }
  1. This is Definitely Possible. Simply add the closeOnContentClick: true, JS option in the modal: function() Function Block to the $.magnificPopup.open Initialization Code.

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

N
nikoslavsDec 11, 2017

Thanks, everything works fine

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard