Skip to content

Instantly share code, notes, and snippets.

@itpcc
Created March 27, 2015 11:26
Show Gist options
  • Save itpcc/1fc9760d2de8a00f0631 to your computer and use it in GitHub Desktop.
Save itpcc/1fc9760d2de8a00f0631 to your computer and use it in GitHub Desktop.
var fullpageOption = {
scrollOverflow: true,
onLeave: function(index, nextIndex, direction){
var cntAllSlide = $("#fullpage .section").length;
console.log('From ->', index, 'to ->', nextIndex, 'All ->', cntAllSlide);
if(cntAllSlide > 4 && nextIndex >= cntAllSlide && index == cntAllSlide-1 && isCongreat && youtubePlayer && typeof youtubePlayer == "object" && typeof youtubePlayer.playVideo !== "undefined"){
youtubePlayer.setVolume(30);
youtubePlayer.playVideo();
isCongreat = false;
}else if(youtubePlayer && typeof youtubePlayer == "object" && typeof youtubePlayer.stopVideo !== "undefined"){
youtubePlayer.stopVideo();
//youtubePlayer.seekTo(0, true);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment