Sanprieto Posted June 16, 2021 Share Posted June 16, 2021 Hello everybody, I try to get a custom cursor using native scroll proxy. I don't know if this is the best way. It's work with mouse move event .I have compensated the transformed position of '#content' but when I make scroll not working. window.addEventListener( 'mousemove', ( event )=>{ const style = window.getComputedStyle(document.querySelector('#content')); const matrix = new WebKitCSSMatrix(style.transform); gsap.to('#triangle',{ x: event.clientX, y: event.clientY - matrix.m42, yPercent:-50, xPercent:-50, duration: .05}) }) Somebody knows how to get this result when we make scrolling? See the Pen QWpYKRb by sanprieto (@sanprieto) on CodePen 1 Link to comment Share on other sites More sharing options...
Solution OSUblake Posted June 16, 2021 Solution Share Posted June 16, 2021 The cursor should have a position of fixed. Here's an example of following the cursor. See the Pen WNNNBpo by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
Sanprieto Posted June 16, 2021 Author Share Posted June 16, 2021 Thank you !!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now