In order for a custom script to work alongside the CartGenie scripts that are used to make your store operational, there is an extra bit of code you must add.
You must wrap each custom script in an event listener:
<script>
document.addEventListener('cartgenie.ready', function () {
INSERT SCRIPT HERE
});
</script>
Let us know if this doesn’t fix your issue.