@widelab-nc/widelab 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -957,13 +957,13 @@ function customGsapEasing() {
|
|
|
957
957
|
|
|
958
958
|
// Update the scroll trigger on page load
|
|
959
959
|
window.updateScrollTrigger = function() {
|
|
960
|
-
const
|
|
960
|
+
const mediaElements = document.querySelectorAll('img, video');
|
|
961
961
|
|
|
962
962
|
const observer = new MutationObserver(function(mutationsList) {
|
|
963
963
|
for(let mutation of mutationsList) {
|
|
964
964
|
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
|
965
965
|
ScrollTrigger.update();
|
|
966
|
-
console.log('Height change')
|
|
966
|
+
console.log('Height change');
|
|
967
967
|
break;
|
|
968
968
|
}
|
|
969
969
|
}
|
|
@@ -971,8 +971,8 @@ window.updateScrollTrigger = function() {
|
|
|
971
971
|
|
|
972
972
|
const config = { attributes: true, childList: true, subtree: true };
|
|
973
973
|
|
|
974
|
-
|
|
975
|
-
observer.observe(
|
|
974
|
+
mediaElements.forEach(function(mediaElement) {
|
|
975
|
+
observer.observe(mediaElement, config);
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
|