Added Reset Button

Included reset button to reset weight inputs, plates required, and plate visuals.
This commit is contained in:
2018-10-21 16:37:25 -04:00
parent c54ac63db9
commit 765e2a4f1c
3 changed files with 29 additions and 1 deletions

View File

@@ -206,6 +206,7 @@ p.subheading {
.b-calulatorinputs__weightinput{
display: inline-block;
text-align: center;
position: relative;
}
@@ -289,6 +290,20 @@ input.input-calculate:focus{
outline-style: none;
}
.b-infoentry__reset{
position: absolute;
top: 0px;
transform: translate(-132%, 132%);
color: #808285;
font-family: "Zilla Slab";
font-size: 14px;
font-style: italic;
font-weight: 500;
letter-spacing: 0.75px;
display: none;
}
.b-infoentry__dividerheading{
display: block;
margin: 16px auto;

View File

@@ -30,7 +30,6 @@
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- Add your site or application content here -->
<div class="b-container" id="header">
<a name="header"></a><div class="b-header">
<div class="b-header__container">
@@ -92,6 +91,7 @@
<div class="b-calulatorinputs__weightinput">
<label for="Weight">WEIGHT (LBS)</label>
<input type="number" inputmode="numeric" pattern="[0-9]*" class="b-infoentry__input input-element input-weight" name="Weight" placeholder="What are you lifting? (LBS)" id="Weight">
<input type="button" name="reset" value="Reset" class="b-infoentry__reset">
<input type="button" class="b-infoentry__button submit-element input-calculate" name="Calculate" value="LIFT" onclick="startcalc()">
</div>
<a href="#options">

View File

@@ -114,6 +114,19 @@
} // End if
});
//show reset button on calculate
jQuery(".input-calculate").click(function(){
jQuery(".b-infoentry__reset").show();
});
//reset inputs and plate visuals
jQuery(".b-infoentry__reset").click(function(){
jQuery(".input-weight, .input-weightsneeded").val('');
jQuery(".input-final, .input-difference").html('0');
jQuery(".b-platevisual__plates").html('');
jQuery(".b-infoentry__reset").hide();
});
//Saves scroll position on focus and restores
var savedScrollTop;
function saveScroll() {