Last active
December 21, 2015 02:09
-
-
Save marcosfreitas/6232910 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 p; | |
var p2; | |
function Play(evnt){ | |
console.info('call'); | |
if(evnt == 'pause'){ | |
console.info('pause'); | |
//esse evento deve pausar o setTimeout em execucação | |
clearTimeout(p); | |
p2 = setTimeout(function(){ | |
if(evnt == 'pause'){ | |
//clearTimeout(p2); | |
Play('play'); // chamada recursiva | |
} | |
},5000); // 5 segundos | |
} else if(evnt == 'play'){ | |
console.info('play'); | |
jQuery('.rightControl').trigger('click'); | |
p = setTimeout(function(){ | |
Play('play'); // chamada recursiva | |
},3000);// 3 segundos | |
} | |
}; | |
jQuery('.leftControl, .rightControl').click(function(){ | |
console.info('left/right Pause'); | |
Play('pause'); | |
}); | |
jQuery('.slide, .leftControl, .rightControl').hover(function(){ | |
console.info(jQuery(this).attr('class')+': slide hover pause'); | |
Play('pause'); | |
}, | |
function(){ | |
console.info('slide hover play'); | |
Play('play'); | |
}); | |
jQuery(window).load(function(){ | |
Play('play'); // chamada recursiva | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
é preciso diferenciar os parâmetros e os tipos de click no right/leftControl entre o simulado e o natural.