Simple spinner
How do I make an simple spinner?
What is a simple spinner? How do you make a simple spinner? This script and codes were developed by Leo on 16 October 2022, Sunday.
Simple spinner - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple spinner</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <form> <input type="number" min="1" max="10" value="1" />
</form> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple spinner - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Lato:400);
body { background: #25323B;
}
form { position: absolute; margin: auto; top: 0; left: 0; bottom: 0; right: 0; width: 150px; height: 50px;
}
input[type=number] { float: left; width: 70px; height: 35px; padding: 0; font-family: Lato; font-weight: 700; font-size: 1.2em; text-transform: uppercase; text-align: center; color: #93504C; border: 2px #93504C solid; background: none; outline: none; pointer-events: none;
}
span.spinner { position: absolute; height: 40px; user-select: none; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
span.spinner > .sub, span.spinner > .add { float: left; display: block; width: 35px; height: 35px; text-align: center; font-family: Lato; font-weight: 700; font-size: 1.2em; line-height: 33px; color: #93504C; border: 2px #93504C solid; border-right: 0; border-radius: 2px 0 0 2px; cursor: pointer; transition: 0.1s linear; -o-transition: 0.1s linear; -ms-transition: 0.1s linear; -moz-transition: 0.1s linear; -webkit-transition: 0.1s linear;
}
span.spinner > .add { top: 0; border: 2px #93504C solid; border-left: 0; border-radius: 0 2px 2px 0;
}
span.spinner > .sub:hover, span.spinner > .add:hover { background: #93504C; color: #25323B;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none;
}
Simple spinner - Script Codes JS Codes
(function($) { $.fn.spinner = function() { this.each(function() { var el = $(this); // add elements el.wrap('<span class="spinner"></span>'); el.before('<span class="sub">-</span>'); el.after('<span class="add">+</span>'); // substract el.parent().on('click', '.sub', function () { if (el.val() > parseInt(el.attr('min'))) el.val( function(i, oldval) { return --oldval; }); }); // increment el.parent().on('click', '.add', function () { if (el.val() < parseInt(el.attr('max'))) el.val( function(i, oldval) { return ++oldval; }); }); }); };
})(jQuery);
$('input[type=number]').spinner();
Developer | Leo |
Username | leonard |
Uploaded | October 16, 2022 |
Rating | 3.5 |
Size | 2,358 Kb |
Views | 16,192 |
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 |
Mouse scroll | 1,860 Kb |
Notification animation collection | 3,905 Kb |
Strings | 2,109 Kb |
Phyramid.com loader | 3,128 Kb |
Spinner | 2,385 Kb |
Time left icon | 3,988 Kb |
Flat checkbox toggle | 2,271 Kb |
Stepper | 6,023 Kb |
Photo selector with bounce animation | 3,366 Kb |
Triangle | 1,796 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 utcwebdev | Utcwebdev | 2,856 Kb |
Blank Starter | Mhartington | 2,171 Kb |
Reading Grid | Tappily | 4,306 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
Image grid with captions | Mchernin34 | 2,222 Kb |
ABVI Menu Discarded | Overdrivemachines | 3,607 Kb |
A Pen by boilzzz | Boilzzz | 2,761 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 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!