Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. jQuery(document).on('click', '.question-list li', function() {
  2.  
  3. jQuery('.curbside-consult').addClass('unclickable');
  4.  
  5. // console.log(jQuery(this));
  6.  
  7. if (jQuery(this).hasClass('true')) {
  8.  
  9. jQuery(this).find('.question-video-wrap').show();
  10. var videoPlay = jQuery(this).find('.question-video');
  11. videoPlay.get(0).play();
  12. // jQuery(this).find('.question-video').trigger('playing');
  13.  
  14. console.log(isPlaying);
  15. if (!isPlaying) {
  16. jQuery(this).find('.question-video').on('ended',function(){
  17. // jQuery(this).find('.question-video').trigger('ended');
  18. console.log('video has ended');
  19. var activeIndex = jQuery(this).closest('.active-slide').index();
  20. console.log(activeIndex);
  21. jQuery(jQuery('.case-slide').get(activeIndex)).removeClass('active-slide');
  22. if (activeIndex == jQuery('.case-slide').length - 1) {
  23. console.log('The concluding video should be showing');
  24. jQuery('.concluding-case-wrap').show();
  25. jQuery('.concluding-case-video').play();
  26. } else {
  27. jQuery(jQuery('.case-slide').get(activeIndex + 1)).addClass('active-slide');
  28. }
  29. });
  30. }
  31. } else if (jQuery(this).hasClass('false')) {
  32. // jQuery(this).find('.question-video').trigger('ended');
  33. console.log('false');
  34. jQuery(this).find('.question-video-wrap').show();
  35. jQuery(this).find('.question-video').get(0).play();
  36. //jQuery(this).find('.question-video').trigger('playing');
  37. jQuery(this).find('.question-video').on('ended',function(){
  38. jQuery(this).closest('.question-video-wrap').hide();
  39. });
  40. } else {
  41.  
  42. }
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement