Play and Pause Bootstrap 3 Button

Size
2,255 Kb
Views
141,680

How do I make an play and pause bootstrap 3 button?

Play and Pause Bootstrap 3 Button using Bootstrap & Font Awesome. What is a play and pause bootstrap 3 button? How do you make a play and pause bootstrap 3 button? This script and codes were developed by Dzulfikar Adi Putra on 06 September 2022, Tuesday.

Play and Pause Bootstrap 3 Button Previews

Play and Pause Bootstrap 3 Button - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Play and Pause Bootstrap 3 Button</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <h3 class="text-center">Play and Pause Bootstrap 3 Button</h3> <p class="text-center"><small>using Bootstrap & Font Awesome </small></p> <hr/> <div class="player text-center"> <button type="button" id="button_fbw" class="btn" onclick='buttonRewindPress()'> <i class="fa fa-fast-backward"></i> </button> <button type="button" id="button_bw" class="btn" onclick='buttonBackPress()'> <i class="fa fa-backward"></i> </button> <button type="button" id="button_play" class="btn" onclick='buttonPlayPress()'> <i class="fa fa-play"></i> </button> <button type="button" id="button_stop" class="btn" onclick='buttonStopPress()'> <i class="fa fa-stop"></i> </button> <button type="button" id="button_fw" class="btn" onclick='buttonForwardPress()'> <i class="fa fa-forward"></i> </button> <button type="button" id="button_ffw" class="btn" onclick='buttonFastforwardPress()'> <i class="fa fa-fast-forward"></i> </button> </div> <p class="text-center"><small>inspired from <a href="http://jsfiddle.net/Zxfn8/" target="_blank">here</a></small></p>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Play and Pause Bootstrap 3 Button - Script Codes CSS Codes

.player{ margin: 50px 0;
}

Play and Pause Bootstrap 3 Button - Script Codes JS Codes

var state = 'stop';
function buttonBackPress() { console.log("button back invoked.");
}
function buttonForwardPress() { console.log("button forward invoked.");
}
function buttonRewindPress() { console.log("button rewind invoked.");
}
function buttonFastforwardPress() { console.log("button fast forward invoked.");
}
function buttonPlayPress() { if(state=='stop'){ state='play'; var button = d3.select("#button_play").classed('btn-success', true); button.select("i").attr('class', "fa fa-pause"); } else if(state=='play' || state=='resume'){ state = 'pause'; d3.select("#button_play i").attr('class', "fa fa-play"); } else if(state=='pause'){ state = 'resume'; d3.select("#button_play i").attr('class', "fa fa-pause"); } console.log("button play pressed, play was "+state);
}
function buttonStopPress(){ state = 'stop'; var button = d3.select("#button_play").classed('btn-success', false); button.select("i").attr('class', "fa fa-play"); console.log("button stop invoked.");
}
Play and Pause Bootstrap 3 Button - Script Codes
Play and Pause Bootstrap 3 Button - Script Codes
Home Page Home
Developer Dzulfikar Adi Putra
Username superpikar
Uploaded September 06, 2022
Rating 3
Size 2,255 Kb
Views 141,680
Do you need developer help for Play and Pause Bootstrap 3 Button?

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!

Dzulfikar Adi Putra (superpikar) Script Codes
Create amazing marketing copy with AI!

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!