How to get javascript overlay to load at startup

I want the overlay load on JavaScript to load to include inviting users to participate in a feedback survey. How can i do this. I do not want a separate window.

+3
source share
3 answers

Christopher

It looks like you need a non-intrusive pop-up dialog, but for this, just overlay the main page and not appear in a separate browser window. "jQuery UI" has many built-in goodies like this one. A simple code example might look like this:

<script src="jquery.js" />
<script src="jquery-ui.js" />
<script type="text/javascript">
$(window).load(function () {
  $("#overlay_box").dialog();
});
</script>
...
<div id="overlay_box">
<!-- your HTML content here -->
</div>

For a demo of the above code, as well as more details, visit: http://jqueryui.com/demos/dialog/

, .
-tjw

+1

div, , , - . sample1, sample2

+1

You can add a function to window.onload, which shows that you are overlapping when the page loads; you also use any infrastructure that has such functionality.

0
source

Source: https://habr.com/ru/post/1736422/


All Articles