Created
October 28, 2015 12:49
-
-
Save ibolmo/45f2987e88e7d4906802 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var last = $('.CardsList-progress span:last-child').text() * 1; | |
| var getNext = function(){ return Math.floor(Math.random() * last) + 1; }; | |
| var current = $('.CardsList-progress span:first-child').text() * 1; | |
| var next = getNext(); | |
| while (current == next) next = getNext(); | |
| console.log('current: ', current, ' next: ', next, ' of: ', last); | |
| var times = Math.abs(current - next); | |
| while (times--){ | |
| $((current < next) ? '.nextButton' : '.previousButton').click(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment