Simple Jquery Calculator
How do I make an simple jquery calculator?
What is a simple jquery calculator? How do you make a simple jquery calculator? This script and codes were developed by Omran Abazid on 15 September 2022, Thursday.
Simple Jquery Calculator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Jquery Calculator</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="box"> <div id='result' class="result"></div> <div class="btn-group"> <button id='hello' class="btn orange first">c</button> <button class="btn yellow">%</button> <button class="btn yellow">/</button> <button class="btn yellow">*</button> <button class="btn first">7</button> <button class="btn">8</button> <button class="btn">9</button> <button class="btn yellow">-</button> <button class="btn first">4</button> <button class="btn">5</button> <button class="btn">6</button> <button class="btn yellow">+</button> <button class="btn first">1</button> <button class="btn">2</button> <button class="btn">3</button> <button class="btn yellow tall">=</button> <button class="btn first last wide">0</button> <button class="btn last">.</button> </div>
</div> <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 Jquery Calculator - Script Codes CSS Codes
* { box-sizing: border-box; padding: 0px; margin: 0px;
}
html,
body { font-family: 'Raleway', sans-serif; background: #91C2FF; padding: 0px; margin: 0px;
}
.box { padding: 20px; width: 400px; height: 400px; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background: #F4F4F4; box-shadow: 0px 0px 17.01px 3.99px rgba(0, 0, 0, 0.31); border: 5px solid #ececee; border-radius: 10px;
}
.box .result { padding-right:10px; color: #fff; font-size: 30px; text-align: right; padding-top: 20px; background: #494646; border: 5px solid #ececee; border-radius: 10px; height: 100px; box-shadow: 0px 0px 17.01 9999998px 3.99px rgba(0, 0, 0, 0.31) inset;
}
.box .btn-group { margin: 10px 0px 10px 5px;
}
.box .btn-group .btn { float: left; border: 1px solid #e5e5e5; background: #fff; width: 80px; height: 40px; border-radius: 5px; font-size: 20px; box-shadow: 0px 2px 2px 0.1px #d5d3d3; margin-left: 7.72725px; margin-bottom: 10px;
}
.box .btn-group .btn:active { box-shadow: 0px 2px 2px 0.1px #d5d3d3 inset;
}
.box .btn-group .btn:focus { outline: none;
}
.box .btn-group .first { margin-left: 0px;
}
.box .btn-group .last { margin-top: -49.9px;
}
.box .btn-group .tall { height: 90px;
}
.box .btn-group .wide { width: 167.72725px;
}
.box .btn-group .orange { border: 1px solid #ee7430; background: #fc8548; color: #fff;
}
.box .btn-group .yellow { border: 1px solid #e5e5e5; background: #fbfbfb;
}
Simple Jquery Calculator - Script Codes JS Codes
var calculator = (function() { var result; var clear; //cache the dom var ScreenDiv = $('#result'); //bind Events $('.btn').on('click', calculate); //custom functions function calculate() { if ($(this).hasClass('orange')) ScreenDiv.html(''); else if ($(this).hasClass('tall')) { result = eval(ScreenDiv.html()); ScreenDiv.html(result); clear = true; } else { if (clear == true) ScreenDiv.html(''); clear = false; ScreenDiv.append($(this).html()); } }
})();
Developer | Omran Abazid |
Username | OmranAbazid |
Uploaded | September 15, 2022 |
Rating | 3 |
Size | 2,462 Kb |
Views | 34,408 |
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 |
Bootstrap-jquery Address Book | 2,650 Kb |
Simon Game without jquery | 3,370 Kb |
Bootstrap page Header Template | 3,140 Kb |
Weather App | 2,596 Kb |
Moving Circle on scroll | 2,006 Kb |
Tic tac toe | 3,323 Kb |
FCC Campers News | 2,535 Kb |
Bootstrap Portfolio Website | 4,146 Kb |
Wikipedia Search using the API | 3,176 Kb |
Convert data into d3 format | 1,879 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 |
Nice textured background | Hans | 2,659 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Css3 loader | Clknap | 2,391 Kb |
Colorful Sliders | Chanrith | 1,246 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
Simple Accordion | Wearebold | 3,683 Kb |
Reading Grid | Tappily | 4,306 Kb |
Lightrays v2 | Sinthetyc | 2,903 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
Tile Animation Thing | Frxnz | 4,332 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!