javascript - jQuery not working with video -


i trying video fade out using jquery

on html have video:

html

  <video playsinline autoplay loop id="video">       <source src="myvideo.mp4" type="video/mp4">   </video> 

then on js file:

var $vid = $('#video');  $vid.delay(2000).fadeout(500); 

instead of fade out video disappear. appreciated.

there seems inconsistency between browsers handling of opacity applied video tag. although reason inconsistency not clear me, able reproduce , solve adding parent div , fading div.

so, html be:

<div>     <video playsinline autoplay loop id="video">         <source src="myvideo.mp4" type="video/mp4">     </video> </div> 

then, js be:

var $vid = $('#video'); $vid.delay(2000).parent().fadeout(500); 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -