You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,6 +54,8 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube-embed/)
54
54
-**"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: () => {}`
55
55
-**"title"** - the title of the video, it is displayed top of container`
56
56
-**"picture"** - the parameter is responsible for generating a thumbnail. `TRUE` - generates picture + source + img. `FALSE` - only generate an img thumbnail
57
+
-**onResize** - this function allows you to change the way the movie is started. We check the width of the window, in the example we set it to 800px, if this value is smaller than assumed, the movie will open in the same place without a lightbox, if greater than 800px, we will open the movie in the lighbox.
58
+
57
59
58
60
```html
59
61
<!-- default -->
@@ -122,7 +124,23 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube-embed/)
122
124
</a>
123
125
</div>
124
126
`)
125
-
}
127
+
},
128
+
onResize: () => {
129
+
let responsiveMin =800;
130
+
131
+
// we check the width of the browser window
132
+
constwindowWidth=
133
+
window.innerWidth||
134
+
document.documentElement.clientWidth||
135
+
document.body.clientWidth;
136
+
137
+
// we return the logical value "true/false"
138
+
// if "true" then the movie is opened in the place
139
+
// of display, if "false" the movie is opened in lightbox
0 commit comments