Jump to content
emilychews

Issue with GSAP Custom Cursor - I can't work out why it breaks.

Recommended Posts

Hi,

 

I have a custom cursor I'm doing with GSAP, which all works OK when I move it around the page. 

 

I'm trying to add a "mouseover" event listener so when you hover over a link the cursor grows, not only is the function I'm using for this not working, but it breaks the entire custom cursor, but I can't work out why this is happening?

 

I've commented out the problematic "mouseover" function in question (at the very bottom of the Javascript) so you can see how the custom cursor should look, can anyone give any suggestions as to why it breaks?

 

Em

See the Pen OqQYxV by emilychews (@emilychews) on CodePen

Share this post


Link to post
Share on other sites

It was just a missing "}" at the end of the growOnHover() function. Have a look here, (and also look at the note at line 42)

 

See the Pen qvxGeG by sgorneau (@sgorneau) on CodePen

 

  • Like 3

Share this post


Link to post
Share on other sites

Just an FYI — I think a lot of people miss the Analyze JS function of CodePen. Hit that little dropdown on the right side of the JS panel and you'll find some helpful tools that can assist in troubleshooting. It'll also direct you to info on the web related to the issue. Here's a screen-grab of your pen.

 

6yaWNH4.jpg

  • Like 5

Share this post


Link to post
Share on other sites

Thank you both. It'd been a long day and that is a tad embarrassing. Ten thousand apologies.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, emilychews said:

Thank you both. It'd been a long day and that is a tad embarrassing. Ten thousand apologies.

 

This is a safe place, @emilychews! Happens to all of us! Just a few days ago, I sat and stared at the following wondering why it wasn't working ... for too long.

 

document.ready( function(){
  //stuff
});

 

I get it 😉

  • Like 1
  • Haha 2

Share this post


Link to post
Share on other sites
18 minutes ago, Shaun Gorneau said:

Happens to all of us!

 

So true. I always think of this meme when I'm hunting down a missing semicolon, comma or a camel case typo is staring at me.

aiZJElY.jpg

  • Like 1
  • Haha 2

Share this post


Link to post
Share on other sites

The worst thing is when you spend two hours visiting forums, rereading documentation, rewriting it ten different ways... end up convinced that you have no idea what you're doing and then you see it... but for the typo, what you had to begin with, was fine. 😵

  • Haha 5

Share this post


Link to post
Share on other sites

I'm awesome at spotting typos.

 

I can spot every single typo in any email I write exactly 100 milliseconds after I press 'send'.

  • Like 2
  • Haha 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.