is it possible in jquery to animate general tags like a or div to their corresponding hover styles without declaring a different classes for each tag/class?
For example a has a:hover in CSS standards, can I let Jquery tell to animate to that style instead of creating two different customs classes?
No, you cannot force an element to be styled as one of its pseudo-classes. These can only be applied by the browser itself.
Generally, you’d define your hover styles for both
:hoverand.hoverso you can still apply the hover style withaddClass('hover').If your hierarchy goes deeper, you’ll end up writing those two selectors quite a lot. Unfortunately, it’s the only way (I know) to do this.