Progress bar for counting checkboxes
How do I make an progress bar for counting checkboxes?
Uses a bit of Javascript to count checkboxes with a JQuery UI progress bar. What is a progress bar for counting checkboxes? How do you make a progress bar for counting checkboxes? This script and codes were developed by James Barnett on 11 August 2022, Thursday.
Progress bar for counting checkboxes - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Progress bar for counting checkboxes</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Progress bar for counting checkboxes</h1>
<form> <p> <input type="checkbox" name = "box1"/> <input type="checkbox"name = "box2" /> <input type="checkbox" name = "box3"/> </p>
</form>
<div class="progressbar-container"> <div class="progressbar-bar"></div> <div class="progressbar-label"></div>
</div>
<div class = "ready"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Progress bar for counting checkboxes - Script Codes CSS Codes
body { margin: 20px 50px; }
h1 { font-size: 1.5em; }
p { margin: 0; }
input[type="checkbox"] { height: 20px; width: 20px; margin-right: 10px;
}
.ready { font-size: 1.5em; }
.ui-progressbar-value { background: lightgreen; }
.progressbar-container { position: relative; width: 350px;
}
.progressbar-bar { height: 25px;
margin: 10px 0;
border-radius: 7px;
}
.progressbar-label { position: absolute; top: 2px; left: 45%; z-index: 2;
}
Progress bar for counting checkboxes - Script Codes JS Codes
$(document).ready(function() { // get box count var count = 0; var checked = 0; function countBoxes() { count = $("input[type='checkbox']").length; console.log(count); } countBoxes(); $(":checkbox").click(countBoxes); // count checks function countChecked() { checked = $("input:checked").length; var percentage = parseInt(((checked / count) * 100),10); $(".progressbar-bar").progressbar({ value: percentage }); $(".progressbar-label").text(percentage + "%"); } countChecked(); $(":checkbox").click(countChecked);
});
Developer | James Barnett |
Username | jamesbarnett |
Uploaded | August 11, 2022 |
Rating | 3.5 |
Size | 2,268 Kb |
Views | 101,200 |
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 |
Ready to Launch | 10,309 Kb |
CSS speech bubble | 2,293 Kb |
Simple CSS Dropdown Menu | 3,822 Kb |
Demo of the US Map jQuery plugin | 2,298 Kb |
Subscribe form | 2,101 Kb |
Marquee using CSS3 keyframe animation | 2,260 Kb |
Extremely simple loading animation | 1,804 Kb |
Browser hack for Firefox | 1,520 Kb |
Simple memory game in JS | 2,500 Kb |
List.js Demo | 5,179 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 |
Right Click Menu | Anodpixels | 2,252 Kb |
Flat design iframe | Damienpm | 1,819 Kb |
Resume | Rottingroom | 5,483 Kb |
Material design buttons | Fischaela | 4,381 Kb |
A form arranged using automatic placement. | Vikasford | 2,103 Kb |
SVG Circle Progress | JMChristensen | 3,368 Kb |
Scroll using CSS | Casperovic | 2,159 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
Rainbow Preloader with Offset-Path | Rachelmcgrane | 2,721 Kb |
Background Images | Jooonebug | 2,100 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!