To solve this problem, you need to have good experience with JS. Understanding of the methods, knowledge bases, and so on.
JS code is more than 1 MB.
Not so much. There are zoos and more.
Today found a plugin for jQuery already 2010.
Starting from this we can guess that there is a huge pile of scripts, which in our days can be reduced to minimal fragments, but again the emphasis in knowledge and experience.
I see for several seconds after loading the appended CSS classes to the body tag. See how long delay before the slider appears.
Otlavlivatsya events, features, and check what is responsible for what. Test. Split your code into logical chunks, create components. It will be easier to work with. If you happen to calculate more than a huge script can rewrite them in a modern style, or Google concise solutions. Using the second option will save time, Yes.
You can use the
as noted in the adjacent answer. It is also very good. And very good separation of code into functions. A very good thing.
So I think you need to learn JS and slowly can start to clean code. Most importantly - don't rush.
And of course, perhaps there are some good methods for solving such problems. You may want to Google, and suddenly you're lucky.