H
H
Heorhii2017-11-27 19:09:16
css
Heorhii, 2017-11-27 19:09:16

How to correctly use an element call with an attribute?

We need to make a regular modal window that will appear when visiting the site after 5 seconds. But, as usual, there are a lot of conventions of course. I use UIkit, there is a modal there, but it is called through uk-toggle, which is incomprehensible to me. Otherwise, no way, css #modal-example is empty (and this will not be solved by setting it to display non for example). It is possible to combine it somehow competently with setTimeout? Maybe hide the button on the site and call it through js after a while? It will work, what is the right thing to do in such a situation?

<a href="#modal-example" uk-toggle>Open</a>
<div id="modal-example" uk-modal>
  <p>Всякая всячина.</p>
</div>

My powerful js that I was hoping to solve)
var modal = document.getElementById('modal-example');
setTimeout(function(){modal.style.display = 'block';}, 5000);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question