I want to know if it is possible to make the javascript files smaller and only but the javascript functions which are needed for this simple slider into one javascript file?
You can always put all your JS in one file if you like, but it may not always be very practical.
One thing you can do is go to the jQuery site and create your own version of it by including only the bits you need. Not sure how easy it is to determine which bits you need for this, though.
It is a hell of a work to do code splitting professionally without any other tools. Tools like webpack help to create code bundles for various entry points. So you only load the source that is required for a page or a set of pages. Digging into automation tools like webpack can take some time. Doing this manually will take you time everytime you have to add or remove something. You would have to download a custom jquery and jquery ui js and css file for every page, depending on what features you use.
Alternatively, I can suggest using nouislider, if you look for a lighter alternative to jquery with jquery ui. (only ~8kb script and ~1.2kb css)