Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#button').click(function(e) {
- timer = setInterval("start()", 2000);
- item = 0;
- max = 2;
- return false;
- });
- // fake click the button
- $('#button').trigger('click');
- function start() {
- (item > max) ? item = 0 : null;
- switch(item) {
- case 0:
- // animate here
- item++;
- case 1:
- // animate here
- item++;
- case 2:
- // animate here
- item++;
- break;
- }
- }
Add Comment
Please, Sign In to add comment