Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update() not calculating the page height correctly, only after refreshing the page, using webflow #541

Open
Kugges opened this issue Dec 7, 2023 · 1 comment

Comments

@Kugges
Copy link

Kugges commented Dec 7, 2023

Hello guys,

i have the issue, that the page height won't be calculated correctly when loading the page after publishing. i have to refresh the page first every time i publish changes so the height is calculated correctly again.

my code:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.min.js"></script>
<script>
const locoScroll = new LocomotiveScroll({
  el: document.querySelector(".locomotive-scroll"),
  smooth: true,
  smartphone: {
      smooth: true
  },
  tablet: {
      smooth: true
  },
	smoothMobile: 1,
  multiplier: 1.0,
});

// Wait 2 seconds then calculate the new page height
setTimeout(() => {  
	locoScroll.update();
}, 2000);

</script>

hereby i'm referring to the docs https://timothyricks.notion.site/Locomotive-Scroll-cfdc6b5523ed43cea0412069a534f07c

the locoScroll.update(); in the end seems to be the problem as i can see from other issues in here, i also tried other functions posted in here, but nothing worked so far for me.

this here is my website:
https://qapsa-green.webflow.io/#machine
if you scroll further down to the next section ("Output Yield"), the image on the left side will be stuck behind the table below, but it should stop way more up. if you refresh the page, the image will be positioned correctly.

image

  • OS: Win10
  • Browser Brave, Chrome, Firefox
  • Version 1.61.100, 119.0.6045.200, 120.0.1

EDIT: i removed the update() function and it didn't do any changes, so maybe it is not the culprit here

@Kugges Kugges changed the title update() not calculating the page height correctly, only after refreshing the page update() not calculating the page height correctly, only after refreshing the page, using webflow Dec 7, 2023
@khalua
Copy link

khalua commented Feb 19, 2024

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants