Refactored custom-horizontal-scroll.js, added functions and improved the readability.