If working for example with bootstrap, it's would be perfect if breakpoints can be based on viewport width.
Suggestion:
-
Add option for viewport width
-
If set to true, use:
var viewportWidth = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
if(object.width >= viewportWidth) {
source = object.src;
return false;
}
-
instead of:
if(object.width >= window.screen.width) {
source = object.src;
return false;
}