| 1 |
jQuery(document).ready(function ($) { |
| 2 |
const watchVideoBtn = $('#ife-watch-video-btn'); |
| 3 |
const videoPopup = $('#ife-wizard-video-popup'); |
| 4 |
const videoFrame = $('#ife-wizard-video-frame'); |
| 5 |
const closePopup = $('#ife-wizard-close-popup'); |
| 6 |
|
| 7 |
// YouTube Video URL - replace with your own |
| 8 |
const videoURL = "https://www.youtube.com/embed/r_186_GDwso?si=wHzFW7Xzbn8610TL&autoplay=1"; |
| 9 |
|
| 10 |
// Open the popup and set video source |
| 11 |
watchVideoBtn.on('click', function () { |
| 12 |
videoFrame.attr('src', videoURL); |
| 13 |
videoPopup.css('display', 'flex'); |
| 14 |
}); |
| 15 |
|
| 16 |
// Close popup on close button click |
| 17 |
closePopup.on('click', function () { |
| 18 |
videoFrame.attr('src', ''); |
| 19 |
videoPopup.css('display', 'none'); |
| 20 |
}); |
| 21 |
|
| 22 |
// Close popup when clicking outside the video frame |
| 23 |
videoPopup.on('click', function (e) { |
| 24 |
if (e.target === this) { |
| 25 |
videoFrame.attr('src', ''); |
| 26 |
videoPopup.css('display', 'none'); |
| 27 |
} |
| 28 |
}); |
| 29 |
}); |
| 30 |
|