(function ($) { $(".video-toggle").on("click", function () { let $btn = $(this); let $video = $("#video-" + $btn.attr("data-id")); if ($btn.text() == "Video ansehen") { $btn.text("Video verstecken"); loadVideo($video); $video.show(0); } else { $btn.text("Video ansehen"); $video.hide(0); } }); function loadVideo($video) { let $iframe = $video.find("iframe"); if (!$iframe.is('[src]')) { $iframe.attr("src", $iframe.attr("data-src")); } } $(document).ready(function () { let $video = $(".video-container"); if ($video.hasClass("auto-load")) loadVideo($video); }); })(jQuery);
(function ($) { $(".video-toggle").on("click", function () { let $btn = $(this); let $video = $("#video-" + $btn.attr("data-id")); if ($btn.text() == "Show Video") { $btn.text("Hide Video"); loadVideo($video); $video.show(0); } else { $btn.text("Show Video"); $video.hide(0); } }); function loadVideo($video) { let $iframe = $video.find("iframe"); if (!$iframe.is('[src]')) { $iframe.attr("src", $iframe.attr("data-src")); } } $(document).ready(function () { let $video = $(".video-container"); if ($video.hasClass("auto-load")) loadVideo($video); }); })(jQuery);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)