Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

problem offset with scroll #5

@keulu

Description

@keulu

You have an issue when you scroll on your page, you don't calculte the value of the Main window scroll.

you can fix it by applying this path

in function getMouse()

add scrollOffset :

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

and calculate the good position

mx = (e.pageX || e.touches[0].clientX) - offsetX + left;
my = (e.pageY || e.touches[0].clientY) - offsetY + top;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions