lots0logs
2/14/2016 - 4:39 PM

WordPress :: Divi Builder :: Pause Background Video Until It Is In The Viewport

WordPress :: Divi Builder :: Pause Background Video Until It Is In The Viewport

<script>
(function($) {
	$(window).load(function() {
		var $fw_section = $('.custom_class');

		$fw_section.waypoint({
			handler: function(direction) {
				$(this.element).find('video')[0].player.play();
			},
			offset: '50%'
		});
		setTimeout(function() {
			$fw_section.find('video')[0].player.pause();
		}, 1000);
	});
})(jQuery);
</script>