YouTube Shortcode with lazy load video and scripts on click - dplugins.com
Sun Jan 30 2022 16:24:47 GMT+0000 (Coordinated Universal Time)
Saved by
@thewhiterussian
.youtube-video-container {
position: relative;
overflow: hidden;
width: 100%;
}
.youtube-video-container::after {
display: block;
content: "";
padding-top: 56.25%;
}
.youtube-video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Code language: PHP (php)
content_copyCOPY
https://dplugins.com/code_snippets/youtube-shortcode-with-lazy-load-video-and-scripts-on-click/
Comments