@widelab-nc/widelab 1.1.2 → 1.1.4
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 +19 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -956,11 +956,27 @@ function customGsapEasing() {
|
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
// Update the scroll trigger on page load
|
|
959
|
-
function
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
window.updateScrollTrigger = function() {
|
|
960
|
+
const sections = document.querySelectorAll('.section');
|
|
961
|
+
|
|
962
|
+
const observer = new MutationObserver(function(mutationsList) {
|
|
963
|
+
for(let mutation of mutationsList) {
|
|
964
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
|
965
|
+
ScrollTrigger.update();
|
|
966
|
+
console.log('Height change')
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
|
|
972
|
+
const config = { attributes: true, childList: true, subtree: true };
|
|
973
|
+
|
|
974
|
+
sections.forEach(function(section) {
|
|
975
|
+
observer.observe(section, config);
|
|
976
|
+
});
|
|
962
977
|
}
|
|
963
978
|
|
|
979
|
+
|
|
964
980
|
// !!!!!!!!! Keep this Alpine init at the end !!!!!!!!!
|
|
965
981
|
window.Webflow ||= [];
|
|
966
982
|
window.Webflow.push(() => {
|
|
@@ -984,6 +1000,5 @@ function updateScrollTrigger() {
|
|
|
984
1000
|
if (window.innerWidth < 992) {
|
|
985
1001
|
disableScrollMenu();
|
|
986
1002
|
}
|
|
987
|
-
updateScrollTrigger();
|
|
988
1003
|
|
|
989
1004
|
});
|