PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

get window scroll position

var top  = window.pageYOffset || document.documentElement.scrollTop,
    left = window.pageXOffset || document.documentElement.scrollLeft;

I'm hoping to find a way to get the current viewable window's position (relative to the total page width/height) so I can use it to force a scroll from one section to another. However, there seems ...

BETA Snippet explanation automatically generated by OpenAI:

Here is what the above code is doing:
1. Get the top and left position of the window
2. Get the scroll position of the window
3. Get the top and left position of the div
4. Subtract the scroll position from the top and left position
5. Add the scroll position to the

Snippet By Tony Lea

ยท

Created October 19th, 2021

ยท

Report Snippet