ab-interchange
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -37,4 +37,5 @@ !(function(name, definition) { | ||
Interchange.defaults = { | ||
lazy : false, | ||
delay : 100 | ||
lazy : true, | ||
delay : 100, | ||
offscreen : 1.5 | ||
}; | ||
@@ -131,3 +132,5 @@ | ||
_inView: function() { | ||
return this.element.getBoundingClientRect().top + $(window).scrollTop() <= $(window).scrollTop() + window.innerHeight; | ||
var scrollTop = $(window).scrollTop(), | ||
windowHeight = window.innerHeight; | ||
return this.element.getBoundingClientRect().top - windowHeight * this.settings.offscreen + scrollTop <= scrollTop + windowHeight; | ||
}, | ||
@@ -134,0 +137,0 @@ |
{ | ||
"name": "ab-interchange", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "AB-interchange: While responsive image loading is not really an easy task even today, here is a solution to manage conditional (based on breakpoints) loading of img, background-image or even HTML content.", | ||
@@ -26,4 +26,4 @@ "main": "ab-interchange.js", | ||
"dependencies": { | ||
"ab-mediaquery": "1.3.1" | ||
"ab-mediaquery": "^1.3.2" | ||
} | ||
} |
@@ -32,4 +32,5 @@ # AB-interchange | ||
abInterchange({ | ||
lazy: false, // or true | ||
delay: 100 // debounce time on scroll event (only when lazy loading is true) | ||
lazy : false,// or true | ||
delay : 100 // debounce time on scroll event (only when lazy loading is true) | ||
offscreen : 1.5 // load items only when in the view + 0.5 | ||
}); | ||
@@ -36,0 +37,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9429
143
67
+ Addedab-mediaquery@1.4.4(transitive)
- Removedab-mediaquery@1.3.1(transitive)
Updatedab-mediaquery@^1.3.2