rytm-webflow 2.1.3 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rytm-webflow",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "rytm webflow pack - ASwap, ShowUp",
5
5
  "main": "scripts/index.js",
6
6
  "scripts": {
@@ -40,6 +40,8 @@ class WebflowListView extends View {
40
40
  */
41
41
  // show list element
42
42
  listElementShow(el, index) {
43
+ // check if element is in viewport
44
+ if (!this.isElementInViewport(el)) return;
43
45
  const stagger = this.webset.stagger ? parseFloat(this.webset.stagger) : DEFAULT_STAGGER;
44
46
  const delay = index * stagger;
45
47
  // search for all webscroll elements
@@ -50,8 +52,6 @@ class WebflowListView extends View {
50
52
  }
51
53
  // show web scroll element
52
54
  webScrollElementShow(el, delay) {
53
- // check if element is in viewport
54
- if (!this.isElementInViewport(el)) return;
55
55
  const propsInitial = this.getTweenProps(el, DATA_ATTR_WEBSCROLL_INIT);
56
56
  const propsShow = this.getTweenProps(el, DATA_ATTR_WEBSCROLL_SHOW);
57
57
  if (propsInitial && propsShow) {
@@ -82,9 +82,8 @@ class WebflowListView extends View {
82
82
  const scrollY = window.scrollY;
83
83
  // element position
84
84
  const elTop = rect.top + scrollY;
85
- const elBottom = elTop + rect.height;
86
85
  // check if element is in viewport
87
- return (elTop < (scrollY + window.innerHeight) && elBottom >= scrollY);
86
+ return (elTop < (scrollY + window.innerHeight));
88
87
  }
89
88
 
90
89
  }