mattvrgs Posted July 21, 2022 Share Posted July 21, 2022 Site URL: https://tangerine-flamingo-d2gk.squarespace.com/ site: https://tangerine-flamingo-d2gk.squarespace.com/ pw: wax Hey all! I'm using this bit of jquery for a custom cursor and on it's own it works great <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( window ).mousemove ( function ( e ) { $( '.cursor' ).css ( { left: e.pageX, top: e.pageY } ); } ); $( window ).mousemove ( function ( e ) { $( 'a' ).on ( 'mouseenter', function ( ) { $( '.cursor' ).addClass ( 'active' ); } ); } ); $( window ).mousemove ( function ( e ) { $( 'a' ).on ( 'mouseleave', function ( ) { $( '.cursor' ).removeClass ( 'active' ); } ); } ); } ); </script> but I believe the function that gets the cursor position is interfering with the CSS Snap Scroll //snap scroll homepage #collection-62d56566e4713f4e4c93ab33 .page-section { scroll-snap-align: start; } that I'm using on the site as well. When you move the mouse while the viewport is moving everything jumps around and gets jittery. I'm not sure if there's a better way to get the mouse position or if I'm totally off base but any help would be appreciated. Thanks! Link to comment
mattvrgs Posted July 22, 2022 Author Share Posted July 22, 2022 I ended up just disabling the snap scroll and at least everything else works. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment