Skip to content

Commit

Permalink
docs: fix typo & improve stick example
Browse files Browse the repository at this point in the history
  • Loading branch information
Drafteed committed Apr 13, 2022
1 parent c27a5d8 commit c13f08e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@ This method allows you to attach the cursor to an element with a magnet effect.

```js
const cursor = new MouseFollower();
const box = document.querySelector('.my-fixed-box');
const el = document.querySelector('.my-fixed-element');

el.addEventListener('mouseenter', () => {
box.addEventListener('mouseenter', () => {
cursor.setStick(el);
});

el.addEventListener('mouseleave', () => {
box.addEventListener('mouseleave', () => {
cursor.removeStick();
});
```
Expand All @@ -335,7 +336,7 @@ or via data attribute:
You can also pass element selector to data attribute:

```html
<div data-cursor-stick-stick="#stick-me">Hover <div id="stick-me">me</div> to stick cursor!</div>
<div data-cursor-stick="#stick-me">Hover <div id="stick-me">me</div> to stick cursor!</div>
```

### Skewing effect
Expand Down

0 comments on commit c13f08e

Please sign in to comment.