Hi people,
I'm not sure if this was asked before, but I couldn't find it, so I have to ask myself...
I want to grab an object (a button) and append a few chars when a user hovers over it.
Essentially, I'm trying to emulate the famous Divi button, that is, the way it adds an arrow on hover.
I have no clue how they coded the button, but I want to learn it, so if you can help out,
I'd be very, very grateful.
Anyway, for my current needs, I only need to emulate the arrow part being added on hover.
My idea is next:
- select the button via ID
- add an on-hover function
- append a simple piece of HTML content (two spaces and a '>')
- ideally, make this animated in the same way the Divi's button animates (both in and out)
In all honesty, I have no clue how to achieve this, but I'm guessing it can be done.
My idea so far is (without the animation):
- $('$button').mouseover(append('<span>  >');
That's how far I got, but even that isn't giving proper results...
I'm working through the console, to note.
I assume I actually need to make a function for this to work, right after
.mouseover,
but my coding skills aren't there yet... If you can help out, please do.
Regards,
Nenad S.