Merge branch 'develop' of cvs2:WP-Themes/gaylordmichigan into develop
authorIan Weller <ian@gaslightmedia.com>
Wed, 7 Jun 2017 19:58:28 +0000 (15:58 -0400)
committerIan Weller <ian@gaslightmedia.com>
Wed, 7 Jun 2017 19:58:28 +0000 (15:58 -0400)
1  2 
js/app.js
js/custom/pageSetup.js

diff --cc js/app.js
+++ b/js/app.js
@@@ -289,14 -289,17 +289,15 @@@ $(document).ready(function () 
  //        if(!video_visible){
  //            $("#wp-custom-header-video-button").trigger('click');
  //            paused = true;
 -//            console.log("PAUSED");
  //        } else {
  //            paused = false;
 -//            console.log('PLAYING');
  //        }
  //
 +//         console.log( $("#wp-custom-header-video-button").text());
  //        $(window).on("scroll", function(){
 -//            console.log(clicked, paused, video_visible);
 -//            
 +////            console.log(clicked, paused, video_visible);
  //            video_visible = $("#wp-custom-header").isOnScreen();
 -//            
++
  //            if(video_visible && clicked === false && paused === true){
  //                $("#wp-custom-header-video-button").trigger('click');
  //                clicked = true;
  //            }
  //        })
  //    });
 +    
 +    $(window).scroll(function() {
 +        $("iframe").each( function() {
 +            if( $(window).scrollTop() > $(this).offset().top - 200 ) {
 +                $(this).css('opacity',1);
 +                player.playVideo();
 +            } else {
 +                $(this).css('opacity',0);
 +                player.stopVideo();
 +            }
 +        });
 +    });
 +
++
  });
@@@ -86,14 -86,17 +86,15 @@@ $(document).ready(function () 
  //        if(!video_visible){
  //            $("#wp-custom-header-video-button").trigger('click');
  //            paused = true;
 -//            console.log("PAUSED");
  //        } else {
  //            paused = false;
 -//            console.log('PLAYING');
  //        }
  //
 +//         console.log( $("#wp-custom-header-video-button").text());
  //        $(window).on("scroll", function(){
 -//            console.log(clicked, paused, video_visible);
 -//            
 +////            console.log(clicked, paused, video_visible);
  //            video_visible = $("#wp-custom-header").isOnScreen();
 -//            
++
  //            if(video_visible && clicked === false && paused === true){
  //                $("#wp-custom-header-video-button").trigger('click');
  //                clicked = true;
  //            }
  //        })
  //    });
 +    
 +    $(window).scroll(function() {
 +        $("iframe").each( function() {
 +            if( $(window).scrollTop() > $(this).offset().top - 200 ) {
 +                $(this).css('opacity',1);
 +                player.playVideo();
 +            } else {
 +                $(this).css('opacity',0);
 +                player.stopVideo();
 +            }
 +        });
 +    });
 +
++
  });