# dyYouTubeLazyLoadJS
This small plugin will lazy load YouTube embed videos on your blogs and websites.


### Status

[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yusufshakeel/dyYouTubeLazyLoadJS)
[![npm version](https://img.shields.io/badge/npm-0.2.6-blue.svg)](https://www.npmjs.com/package/dyyoutubelazyloadjs)
[![](https://data.jsdelivr.com/v1/package/npm/dyyoutubelazyloadjs/badge)](https://www.jsdelivr.com/package/npm/dyyoutubelazyloadjs)

### Getting Started
* Download the [latest release](https://github.com/yusufshakeel/dyYouTubeLazyLoadJS/releases) of the project.
* Clone the repo: `git clone https://github.com/yusufshakeel/dyYouTubeLazyLoadJS.git`
* Install with npm: `npm install dyyoutubelazyloadjs`
* Use from jsDelivr CDN: `https://www.jsdelivr.com/package/npm/dyyoutubelazyloadjs`


### Setup

#### Include CSS

Include the css file in the head.

```html
<link rel="stylesheet" href="path/to/dist/css/dyYouTubeLazyLoad.min.css" />
```

#### Include JavaScript

Include the js file before the ending body tag.

```html
<script src="path/to/dist/js/dyYouTubeLazyLoad.min.js"></script>
```

#### The container

Create div having class to dy-yt-lazyload and data-videoid attribute to the YouTube video id.

Example:

```html
<div class="dy-yt-lazyload-container" data-videoid="FZjXYSmCntU"></div>
```

## License
It's free and released under [MIT License](https://github.com/yusufshakeel/dyYouTubeLazyLoadJS/blob/master/LICENSE) Copyright (c) 2019 Yusuf Shakeel

## Back this project 🙏

If you find this project useful and interesting then please support it on [Patreon](https://www.patreon.com/yusufshakeel).

## Donate
Feeling generous :-) Buy me a cup of tea ☕.

[Donate via PayPal](https://www.paypal.me/yusufshakeel)
