Overview
Check if in Viewport

⚠️ Work in progress ⚠️

Attention: This script showcased on this page is not finished! It might not work as intended under certain conditions, on certain browsers or on certain devices. The JavaScript filed linked in the code section below is still subject to change and could break pages which used the older file. If you would like to report errors or make suggestions for new features you can do this here.

false

Check if in Viewport

This script is the custom code equvalent of the very useful webflow element trigger "scroll into view". It can be the starting point for lots of custom code functions where the functionality of webflows animations just don't quite cut it. This script can be set up to look if an element is fully or partially in view.

Demo

Am I in the Viewport?
fully in viewport
yes
partially in viewport
yes

Code

Attention: This code is linked to external files which might change or become unavailable in the future!

To make the code below easier and faster to implement it relies on files which are hosted externally on our servers. Because of that we cannot give you a 100% guarantee, that these files will always stay the same, or will always be accessible through the link provided. For better reliability we therefor advice you to host these files by yourself or add its content directly in Webflow. You can learn more about this topic here.
https://eseassets.ch/globalscripts/code/code.js
Download File

Add this code inside the <head> tag on your page.

Copy code
The code in here is only visible on the published website.
Go to codeblocks.webflow.io or take the code from the actual custom code field of this page

Add this code before the </body> tag on your page.

Copy code
The code in here is only visible on the published website.
Go to codeblocks.webflow.io or take the code from the actual custom code field of this page
We won't take any responsibility for the code provided. It may not be set up according to best practices of programming or built in the most efficient way possible. It's just here so solve your problem.

Get the source code for
free by signing up to Codeblocks