Skip to content

Commit a3c6cb5

Browse files
Merge pull request #26 from tomik23:picture
feat: Picture
2 parents 294c272 + 3e303d3 commit a3c6cb5

21 files changed

+225
-41
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
3939
#### You can download from CDN as well
4040
```html
4141
<!-- CSS -->
42-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tomik23/[email protected].2/dist/css/youtubeLazy.min.css"/>
42+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tomik23/[email protected].3/dist/css/youtubeLazy.min.css"/>
4343

4444
<!-- JS -->
45-
<script src="https://cdn.jsdelivr.net/gh/tomik23/[email protected].2/dist/js/youtubeLazy.min.js"></script>
45+
<script src="https://cdn.jsdelivr.net/gh/tomik23/[email protected].3/dist/js/youtubeLazy.min.js"></script>
4646
```
4747

4848

@@ -53,6 +53,7 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
5353
- **"maxWidth": 50** - the video opens to the given width, it is a percentage, in this example 50%, if there is no number then the video opens to the whole window - 100%. You can also set a global `maxWidth` for all videos that open in the lightbox. Just add the same `maxWidth: 80` parameter to option, see the example below
5454
- **"openIn"** - this parameter allows you to display a button which, when clicked, directly opens the youtube page with the movie. For full functionality you need the corresponding parameter also added to js, see below `createWatchIn: () => {}`
5555
- **"title"** - the title of the video, it is displayed top of container`
56+
- **"picture"** - the parameter is responsible for generating a thumbnail. `TRUE` - generates picture + source + img. `FALSE` - only generate an img thumbnail
5657

5758
```html
5859
<!-- default -->
@@ -69,6 +70,9 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
6970

7071
<!-- add title -->
7172
<div class="ytLazy__item" data-yt='{ "id": "XHeDps0fX6c", "title": "Movie title ;)" }'></div>
73+
74+
<!-- add picture -->
75+
<div class="ytLazy__item" data-yt='{ "id": "XHeDps0fX6c", "picture": true }'></div>
7276
```
7377
> off course you can mix all of them
7478
@@ -98,6 +102,9 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
98102
// default false
99103
overflow: true,
100104
105+
// genereate picture > source
106+
picture: true,
107+
101108
// create your own button to open youtube video page
102109
createWatchIn: ({ link, template }) => {
103110
template(`
@@ -142,8 +149,8 @@ If you need IE support, add this pollyfil to html
142149

143150
### cdn
144151

145-
- https://cdn.jsdelivr.net/gh/tomik23/[email protected].2/dist/js/youtubeLazy.ie.min.js
146-
- https://cdn.jsdelivr.net/gh/tomik23/[email protected].2/dist/css/youtubeLazy.ie.min.css
152+
- https://cdn.jsdelivr.net/gh/tomik23/[email protected].3/dist/js/youtubeLazy.ie.min.js
153+
- https://cdn.jsdelivr.net/gh/tomik23/[email protected].3/dist/css/youtubeLazy.ie.min.css
147154

148155
## License
149156

dist/css/youtubeLazy.ie.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)