Slider Revolution WP
09.27.2016
The script below will wait for the Grid to load, and then start a JavaScript “timer” that runs and changes the pagination. It’s designed to pause the timer automatically if the user hovers their mouse anywhere on top of the Grid, and then restart when the user moves their mouse away from the Grid.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
(function() { // change the number "3000" to however many seconds should pass before the Grid's page changes var interval = 3000, timer, mouseOn; jQuery('.esg-grid').on('mouseenter', function() { mouseOn = true; clearInterval(timer); }).on('mouseleave', mouseOut); function mouseOut() { mouseOn = false timer = setInterval(changeGrid, interval); } function changeGrid() { jQuery('.esg-right').trigger('click'); } var gridLoaded = setInterval(function() { if(jQuery('.esg-grid').is(':visible')) { clearInterval(gridLoaded); if(!mouseOn) mouseOut(); } }, 500); })(); |