- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Convert simple jQuery to plain JavaScript.
Hi guys, I have been using jQuery for a while now, but I never really learned JS. I am trying to stop using jQuery completely. Here are some simple jQuery lines, could anyone please help me convert them to plain JavaScript. Also if you have the time could you explain how you did it? Thanks for your time.
jsfiddle.net/uudtLo1s/
Short story – it’s not really possible to then make it functional because it seems to be working with a jQuery sticky plugin…
Also, some of the methods that look quite simple are rather complicated to replicate with plain JS. So it would be quite a bit of labour altogether.
Other than the plugin, is it too hard/ time consuming? If so I will just leave this as it is. Should you suggest me to start next time using JS from the start or just continue using Jquery?
I would always recommend using as much plain JS as one can but looking at this script and the methods used, I’d say jQuery is the right way to go. Toggling classes and finding near elements is it’s strong suit (and very circumventive with vanilla JS). Fades are usually done with CSS these days but are also very easy with JQ.
So it much depends on the particular script. I’d stick with what you currently have in this case though.
Just a humble opinion of course. If someone feels inclined to give it a go that would naturally be great.
Starting your own little library and creating similar methods can be quite tempting once you decide to go all vanilla.