HTML5 Video Play on Hover
How do I make an html5 video play on hover?
Play an HTML5 Video on hover using gifycat.Combine with Video url (vimeo/youtube) to grab thumbnail. What is a html5 video play on hover? How do you make a html5 video play on hover? This script and codes were developed by Gil on 28 September 2022, Wednesday.
HTML5 Video Play on Hover - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>HTML5 Video Play on Hover</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!--
Data: https://gfycat.com/cajax/get/VerifiableTerrificHind
Source: https://www.youtube.com/watch?v=nZcejtAwxz4
More info on youtube api for thumbnails: http://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api
-->
<div id="videosList">
<div class="video"> <video class="thevideo" loop preload="none"> <source src="https://giant.gfycat.com/VerifiableTerrificHind.mp4" type="video/mp4"> <source src="https://giant.gfycat.com/VerifiableTerrificHind.webm" type="video/webm"> Your browser does not support the video tag. </video> </div> Hover mouse over video. Desktop only [ Obviously! ;) ]
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
HTML5 Video Play on Hover - Script Codes CSS Codes
#videosList { max-width: 600px; overflow: hidden;
}
.video { background-image: url('https://img.youtube.com/vi/nZcejtAwxz4/maxresdefault.jpg'); height: 330px; width: 600px; margin-bottom: 50px;
}
/* Hide Play button + controls on iOS */
video::-webkit-media-controls { display:none !important;
}
HTML5 Video Play on Hover - Script Codes JS Codes
var figure = $(".video").hover( hoverVideo, hideVideo );
function hoverVideo(e) { $('video', this).get(0).play();
}
function hideVideo(e) { $('video', this).get(0).pause();
}
Developer | Gil |
Username | gil-- |
Uploaded | September 28, 2022 |
Rating | 4.5 |
Size | 2,219 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Horizontal Scroll Textarea | 1,197 Kb |
SVG SMIL Circular Spinner Animation | 1,894 Kb |
HTML5 Input | 5,824 Kb |
Pitchfork Link Underline | 1,688 Kb |
Animated Music Jukebox | 3,793 Kb |
Parallax Background | 2,611 Kb |
Cross Hands Animated Emoji | 4,107 Kb |
Animated Money Emoji with CSS | 4,020 Kb |
A Pen by Gil | 2,590 Kb |
CSS Snackables - Week 1 | 8,153 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Exploding Text | Jjmartucci | 4,749 Kb |
Classy Blockquote Styling | Andrewwright | 3,212 Kb |
Shape Outside - Polygon | Stacy | 3,954 Kb |
BSP Dungeon Generation | Xgundam05 | 5,326 Kb |
Tab panels | Accessibility | 0 Kb |
Mondrian | Chrisarmstrong | 2,787 Kb |
Basic HTML Slideshow | Tomhodgins | 3,386 Kb |
Count up | Alanshortis | 2,391 Kb |
Caputre Cam with JS | KimmoCommit | 2,795 Kb |
About Mazano | Kiti | 2,585 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!