Hero video mute/unmute button
How do I make an hero video mute/unmute button?
What is a hero video mute/unmute button? How do you make a hero video mute/unmute button? This script and codes were developed by [SHM] on 17 January 2023, Tuesday.
Hero video mute/unmute button - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hero video mute/unmute button</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body> <div class="video-background"> <video id="player" preload="none" poster="video/big-buck-bunny.jpg" autoplay="autoplay" loop="loop"> <source src="https://georgepaterson.github.io/jquery-videobackground/video/big-buck-bunny.mp4" type="video/mp4"> <source src="https://georgepaterson.github.io/jquery-videobackground/video/big-buck-bunny.webm" type="video/webm"> <source src="https://georgepaterson.github.io/jquery-videobackground/video/big-buck-bunny.ogv" type="video/ogg"> </video> <div id="mute" class="btn"></div> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Hero video mute/unmute button - Script Codes CSS Codes
*{ margin: 0; padding: 0;
}
body{ height: 2500px;
}
.video-background{ height: 100vh; position: relative; margin: 0 !important; top: 0; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden;
}
video{ margin: auto; position: absolute; top: 0%; left: 0%; transform: translate(0%, 0%); width: 100%;
/* height: auto; */
}
#mute{ cursor: pointer; height: 50px; width: 50px; position: absolute; top: 50px; right: 50px; border: 1px solid #000; background-size: cover;
}
Hero video mute/unmute button - Script Codes JS Codes
$(document).ready(function() { if ($("video").prop('muted', false)){ $("#mute").css("background-image","url(http://image.flaticon.com/icons/svg/10/10430.svg)"); } $("#mute").click( function (){ if( $("video").prop('muted') ) { $("video").prop('muted', false); $("#mute").css("background-image","url(http://image.flaticon.com/icons/svg/10/10430.svg)"); } else { $("video").prop('muted', true); $("#mute").css("background-image","url(http://image.flaticon.com/icons/svg/10/10776.svg)"); } }); });
Developer | [SHM] |
Username | leon9208 |
Uploaded | January 17, 2023 |
Rating | 3 |
Size | 2,165 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 |
Cyclotron | 1,798 Kb |
Scroll Bar indicator | 1,840 Kb |
Image autoscroll | 2,008 Kb |
Glitch text effect | 3,674 Kb |
Video header | 2,039 Kb |
Hero zoom on scroll | 1,960 Kb |
Video mute | 2,131 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 |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
Loading Bar | Jaradlight | 2,333 Kb |
Flower expansion | Sreucherand | 3,425 Kb |
Rotating Preloader with Anime.js | Tamashi | 2,450 Kb |
Price | Catcode | 2,623 Kb |
Javascript Welcome | Peterlewicki | 1,573 Kb |
03 - CSS Variables | Run-time | 2,682 Kb |
A Pen by Jess | Jessamyne | 5,100 Kb |
Rotate Demo | Agelber | 3,061 Kb |
Sticky footer testing | 75th | 1,649 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!