I have a pseudoclass element(:after to be specific), and I want to scroll to top when I click on it. Somehow this does not work...
I tried this:
$('.someclass:after').click(function () {
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
And it does not work. When I use just the normal class, it works perfectly:
$('.someclass').click(function () {...});
So I assume, the code works, jquery works, but somehow not with a pseudoclass selector. How can I fix this? To use a normal class is not an option, it has to be my :after class selector.
Thank you!