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 |
Video header | 2,039 Kb |
Scroll Bar indicator | 1,840 Kb |
Glitch text effect | 3,674 Kb |
Image autoscroll | 2,008 Kb |
Cyclotron | 1,798 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 |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
Angular Route | Arun_v606 | 1,837 Kb |
Get third wednesday | Wojtek1150 | 2,691 Kb |
OnScreenAction | Ozgursagiroglu | 2,647 Kb |
Loading... | Adamjacob | 2,384 Kb |
Minimelephant | Smashlee | 2,507 Kb |
Slide like Mailbox | Hmps | 3,758 Kb |
Simple Accordion | Wearebold | 3,683 Kb |
Retina canvas w. resize | Erikterwan | 1,882 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!