# poll-maker/5.6.3/admin/js/poll-maker-ays-welcome.js

Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls, version 5.6.3. 36 lines.

- Page: https://pluginprobe.com/plugins/poll-maker/5.6.3/code/admin/js/poll-maker-ays-welcome.js
- Raw: https://pluginprobe.com/plugins/poll-maker/5.6.3/raw/admin/js/poll-maker-ays-welcome.js
- Modified: 2025-01-21T09:06:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/poll-maker/5.6.3/code/admin/js/poll-maker-ays-welcome.js#L10-L20`.

```javascript
(function ($) {
    // Open modal and play How To video.
    $( document ).on( 'click', '#poll-maker-welcome .play-video', function( event ) {
        event.preventDefault();

        var video = '<div class="poll-maker-welcome-video-container"><iframe height="400" loading="lazy" src="https://www.youtube.com/embed/0dfJQdAwdL4" frameborder="0" allowfullscreen></iframe></div>';

        var modal = $('<div class="poll-maker-welcome-modal"></div>');
        var modalContent = $('<div class="poll-maker-welcome-modal-content"></div>');
        var closeIcon = $('<span class="poll-maker-welcome-modal-close">&times;</span>');

        modal.append(modalContent);
        modalContent.append(closeIcon);
        modalContent.append(video);

        $('body').append(modal);

        closeIcon.on('click', function () {
            modal.remove();
        });

        $(document).on('keyup', function (event) {
            if (event.key === 'Escape') {
                modal.remove();
            }
        });

        modal.on('click', function (event) {
            if (!$(event.target).closest('.poll-maker-welcome-modal-content').length) {
                modal.remove();
            }
        });

    } );
})(jQuery);

```
