Same as https://github.com/Victa/Glisse.js/pull/11/files#r4100772 here