$(this)
returns a jQuery object, so it doesn’t make sense to ask how to implement this outside of jQuery.
What you can implement is the addClass
function, which you can easily do using DOM:
this.className += "animated doneAnimated" + (pageLoaded ? " fadeInUp" : ""));
That way you use vanilla javascript to alter classes.
However, zepto already supports addClass functionality and zepto also supports $(this)
where this
is any DOM element.
You should look into what the waypoint function passes as an argument to your function: There seems to be something else that’s wrong with your code. Can you point out the exact error message that you can and come up with a minimal testcase?
1
solved write $(this) of Jquery in pure javascript [closed]