0

model is opening on click :

 <a href="#" data-remodal-target="test" >test</a> 

my model code is :

 <div class="remodal" data-remodal-id="test"> <h3 class="modal-middle-heading">Buy</h3> <p>Please select your desired gift city.</p> <form class="login-form"> <input type="text" placeholder="Search City" /> </form> <button>Search</button> </div> 

How can I open model on load ?

1

2 Answers 2

2

Try this,

<script type="text/javascript"> $(window).load(function(){ $('#test').modal('show'); }); </script> 
Sign up to request clarification or add additional context in comments.

Comments

1

Assuming you are using remodal, you could just programmatically open the model on your onload event. Something like this:

 window.onload = function () { $('[data-remodal-id=test]').remodal().open(); }; 

See demo

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.