Skip to content

Instantly share code, notes, and snippets.

@ryandejaegher
Created June 5, 2020 19:56
Show Gist options
  • Select an option

  • Save ryandejaegher/cd4ed1b420eb219ab3a1520777e8b16f to your computer and use it in GitHub Desktop.

Select an option

Save ryandejaegher/cd4ed1b420eb219ab3a1520777e8b16f to your computer and use it in GitHub Desktop.
// Add to Code Injection -> Footer
<script>
window.addEventListener('load', function(){
var next = document.querySelector('.summary-carousel-pager-next');
var autoSlide = function(){
next.click()
};
var startSlideInterval = function(){
interval = setInterval(autoSlide,2000);
console.log('interval started');
}
var interval;
var stopSlideInterval = function() {
clearInterval(interval);
console.log('interval cleared')
}
var summarySection = document.querySelector('[data-section-id="5ecc4a6ae3d0ce7bf21dda19"]');
summarySection.addEventListener('mouseover', stopSlideInterval);
summarySection.addEventListener('mouseout', startSlideInterval);
startSlideInterval()
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment