• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

176
Views
jQuery Toggle Class on "a" Link Hover

I have a custom cursor div which changes when hovering over various elements. So far, I have the cursor expanding on hover of .nav-item-wrapper and shrinking on hover of p.

I'm attempting to have the .cursor-div is--link class toggle on hover of all a but running into problems.

The current draft URL

Here is my jQuery inside of the <body>:

<script>

$('.nav-item-wrapper').on('mouseenter mouseleave', function() {
  $(this).toggleClass('is--active');
  $(this).find('.nav-highlight').toggleClass('is--active');
});

/**pointer link hover toggle**/
$('.nav-item-wrapper').not('.w--current').on('mouseenter mouseleave', function() {
  $('.cursor-div').toggleClass('is--link');
});

/** pointer text hover toggle **/
$('p').on('mouseenter mouseleave', function() {
  $('.cursor-div').toggleClass('is--text');
});

</script>

I attempted to add this but it interferes with the .nav-item-wrapper class change.

$('a').on('mouseenter mouseleave', function() {
  $(cursor-div).toggleClass('is--link');;
});
about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error