Fancy Cursor Animations In jQuery & GSAP - Cursor & Magnetic

File Size: 319 KB
Views Total: 6588
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Fancy Cursor Animations In jQuery & GSAP - Cursor & Magnetic

A custom cursor plugin that helps you create fancy and customizable cursors with custom hover state when hovering over elements.


  • Custom background color.
  • Custom cursor text.
  • Exclusion or opaque mode.
  • Custom cursor size.
  • Sticky & Magnetic effects.
  • Based on jQuery and GSAP.

See It In Action:

See Also:

How to use it:

1. Download the package and import the necessary resources in your project.

import $ from 'jquery';
import Cursor from "cursor";
import Magnetic from "magnetic";

2. Initialize the custom cursor plugin.

const cursor = new Cursor({
      container: "body",
      speed: 0.7, // animation speed
      ease: "expo.out", // gsap easing
      visibleTimeout: 300

3. Apply a Magnetic effect.

const magnetic = new Magnetic(el, {
      y: 0.2, // horizontal delta
      x: 0.2, // vertical delta
      s: 0.2, // speed
      rs: 0.7 // release speed

4. Set the background color of the custom cursor with .setState('colorClass') or [data-cursor="colorClass"] attribute.

<div data-cursor="colorClass">

5. Set the text displayed in the custom cursor with .setText('Text') or [data-cursor-text="Text"] attribute.

<div data-cursor-text="jQueryScript">

6. Set the display mode with .setState('-opaque') or [data-cursor="-opaque"] attribute.

<div data-cursor="-exclusion">

7. Set the cursor size with .setState('sizeClass') or [data-cursor="sizeClass"] attribute.

<div data-cursor="sizeClass">

8. Set sticky cursor with <code>.setStick(element) or [data-cursor-stick="selector"] attribute.

<div data-cursor-stick="element">

This awesome jQuery plugin is developed by michaelgudzevskyi. For more Advanced Usages, please check the demo page or visit the official website.