stamat / youtube-background

ESM / jQuery plugin for creating video backgrounds from YouTube, Vimeo or video file links.

Home Page:https://stamat.github.io/youtube-background/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with non-jquery working

todd-kruger opened this issue · comments

First, thank you so much for making this public.

I tried to recreate your demo with non-jquery but it is not working. Please see codepen https://codepen.io/tkruger/pen/poQGWNW

I used new VideoBackgrounds('[data-vbg]'); to call the script.

Any help would greatly be appreciated! Or if you could post a demo without jQuery (and font awesome if possible) that would rock. Trying to avoid large JS libraries when creating features for a website.

Replace thedata-youtube attribute with data-vbg and it will work.

Ah, sorry for the late replies, I've been quite busy @Xeno4j . In the pen you've sent the HTML is

<div id="ytbg" data-ytbg-fade-in="true" data-youtube="https://www.youtube.com/watch?v=eEpEeyqGlxA"></div>

As you can see there is no [data-vbg] attribute, but a [data-youtube] attribute, and changing to [data-youtube] will make the script work.