It would be great if you could pass the element triggering the mouseenter/mouseleave events (as well as the cursor element itself) as arguments to the respective callback functions. In my case, I would like to target elements with the [data-cursor] attribute and assign the value of said attribute as a class.
const options = {
focusElements: [
{
elements: '[data-cursor]',
mouseenter: (cursor, el) => {
var class = $(el).attr('data-cursor');
$(cursor).addClass(class);
},
mouseleave: (cursor, el) => {
var class = $(el).attr('data-cursor');
$(cursor).removeClass(class);
},
},
],
}
Otherwise great work on the library!
It would be great if you could pass the element triggering the mouseenter/mouseleave events (as well as the cursor element itself) as arguments to the respective callback functions. In my case, I would like to target elements with the
[data-cursor]attribute and assign the value of said attribute as a class.Otherwise great work on the library!