Search
 
SCRIPT & CODE EXAMPLE
 

HTML

slider video play

	<div id="slideBox">
		<!--Sidebar-->
			
		<div id="main-image" class="sliderMain">
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div><img src="https://placeimg.com/640/480/any"></div>
			<div id="slide-video">
				<video width="900px" id="theVideo">
					<source src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" />
				</video>
			</div>
		</div>
			
	</div><!--slideBox-->

<script>
		$(document).ready(function() {
    $('.sliderMain').slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        arrows: false,
        fade: false,
        autoplay: true,
        autoplaySpeed: 3000,
        infinite: false,
    });

    $('.sliderMain').on('afterChange', function(event, slick, currentSlide) 
    {
        var video = $('.sliderMain .slick-active').find('video');
        if ($('.slick-current').find('video').length !== 0) 
        {
            $('.sliderMain').slick('slickPause');
            theVideo.play();
        }
    });
    document.getElementById('theVideo').addEventListener('ended', myHandler, false);
    function myHandler(e) 
  	{
        $('.sliderMain').slick('slickPlay');
    }
});
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: allow only number in input html 
Html :: android strings plural 
Html :: html player 
Html :: page break html 
Html :: ng-src 
Html :: input type text inside select option 
Html :: tooltip react bootstrap 
Html :: markdown image by address 
Html :: object htmldivelement to string 
Html :: thymeleaf form delete method 
Html :: vuejs v-for array index 
Html :: html login and registration form 
Html :: scroll to a section of your page html 
Html :: insertar playlist youtube html5 
Html :: bootstrap starter code 
Html :: section tag in html 
Html :: twig array keys and values 
Html :: how to use p in html 
Html :: html select default value 
Html :: delete html 
Html :: html chart 
Html :: how to insert code in html 
Html :: html tooltip attribute 
Html :: beautify html code in vscode 
Html :: how to add bg html 
Html :: pt serif 
Html :: how to make common header and footer in html 
Html :: html injection 
Html :: create ion card 
Html :: input type checkbox and hide checkbox 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =