I'm currently in the process of working on this page for a project
$(function() {
$(".modal-launcher, #modal-background").click(function() {
$(".modal-content, #modal-background").toggleClass("active");
$(".vid-1i").attr("src", "link1");
$(".vid-2i").attr("src", "link2");
$(".vid-3i").attr("src", "link3");
$(".vid-4i").attr("src", "link4");
$(".vid-5i").attr("src", "link5");
$(".vid-6i").attr("src", "link6");
$(".vid-7i").attr("src", "link7");
$(".vid-8i").attr("src", "link8");
//$('html').toggleClass('active').css('top', -(document.documentElement.scrollTop) + 'px');//
});
});
Just a quick note that the actual links have been replaced above for demonstration purposes.
I'm trying to create my own video popup launcher using jQuery on this page. However, I'm facing difficulties in using jQuery to change the "src" attribute of an iframe element to a YouTube link. I can't seem to figure out what's wrong with the jQuery code. I acknowledge that the problem lies in my code rather than the functionality of jQuery, and I'm seeking help to identify my error or make necessary modifications for it to work.
Interestingly, the last video in the list provided by jQuery always gets fetched.
Please note that the images may not appear on the page as they are local files and not hosted online. Clicking above the captions resembling "Match One" will still yield the "expected" outcome, regardless of the image display.