Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- See https://metroui.org.ua for details of the UI library  -->

<center>
<div id="jogcontrols" class="mt-2">
            <div class="row flex-justify-center flex-align-start" style="width: 100%; height: 100%;">
              <div class="cell">
                <nav data-role="ribbonmenu" class="mt-2">
                  <ul class="tabs-holder ml-17">
                    <li onclick="mmMode();"><a id="mmMode" href="#tab-mm">mm-mode</a></li>
                    <li onclick="inMode();"><a id="inMode" href="#tab-inch">inch-mode</a></li>
                  </ul>
                </nav>
                <table class="drotable mt-2">
                  <tr>
                    <td>
                      <button class="button light jogbtn" onclick="sendGcode( 'G10 P1 L20 X0')" style="width: 60px;" data-role="ripple" data-ripple-color="#e21b1b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-crosshairs fg-openbuilds" data-fa-transform="shrink-2 down-8 left-12"></i>
                          <span class="fa-layers-text fg-red" data-fa-transform="down-9 right-8" style="font-weight:900; font-family: Arial; font-size: 12px;">X</span>
                          <span class="fa-layers-text fg-openbuilds" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">setzero</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <div class="dro">
                        <div class="float-left fg-red" data-fa-transform="right-15">
                          <span class="fa-layers fa-fw">
                            <span class="fa-layers-text fg-red" data-fa-transform="right-3">X</span>
                          <span class="fa-layers-text fg-red" data-fa-transform="left-18 rotate-270" style="font-family: Arial; font-size: 8px;">WORK</span>
                          <!-- <span class="fa-layers-text fg-red" data-fa-transform="left-20 rotate--90" style="font-family: Arial; font-size: 11px;">work</span> -->
                          </span>
                        </div>
                        <div class="float-right fg-red" id="xPos" data-editable>0.000</div>
                        <input id="xPosInput" class="m-0 p-0 droInput float-right fg-red" data-editable="true" />
                      </div>
                    </td>
                    <td>
                      <div class="pos-relative">
                        <button class="button light jogbtn" style="width: 42px;"><i class="fas fa-caret-down fg-openbuilds"></i></button>
                        <ul class="d-menu context drop-shadow drop-right" data-role="dropdown">
                          <li><a href="#" onclick="sendGcode( 'G0 X0')"><span class="fas fa-chart-line fg-red icon"></span>Goto X0 (Work Coord) (G0 X0)</a></li>
                          <li id="gotoXzeroMpos"><a href="#" onclick="sendGcode( 'G53 G0 X0')"><span class="fas fa-chart-line fg-red icon"></span>Goto X0 (Machine Coord) (G53 G0 X0)</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <button class="button light jogbtn" onclick="sendGcode( 'G10 P1 L20 Y0')" style="width: 60px;" data-role="ripple" data-ripple-color="#5de21b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-crosshairs fg-openbuilds" data-fa-transform="shrink-2 down-8 left-12"></i>
                          <span class="fa-layers-text fg-green" data-fa-transform="down-9 right-8" style="font-weight:900; font-family: Arial; font-size: 12px;">Y</span>
                          <span class="fa-layers-text fg-openbuilds" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">setzero</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <div class="dro">
                        <div class="float-left fg-green">
                          <span class="fa-layers fa-fw">
                            <span class="fa-layers-text fg-green" data-fa-transform="right-3">Y</span>
                          <span class="fa-layers-text fg-green" data-fa-transform="left-18 rotate-270" style="font-family: Arial; font-size: 8px;">WORK</span>
                          </span>
                        </div>
                        <div class="float-right fg-green" id="yPos" data-editable>0.000</div>
                        <input id="yPosInput" class="m-0 p-0 droInput float-right fg-green" data-editable="true" />
                      </div>
                    </td>
                    <td>
                      <div class="pos-relative">
                        <button class="button light jogbtn" style="width: 42px;"><i class="fas fa-caret-down fg-openbuilds"></i></button>
                        <ul class="d-menu context drop-shadow drop-right" data-role="dropdown">
                          <li><a href="#" onclick="sendGcode( 'G0 Y0')"><span class="fas fa-chart-line fg-green icon"></span>Goto Y0 (Work Coord) (G0 Y0)</a></li>
                          <li id="gotoYzeroMpos"><a href="#" onclick="sendGcode( 'G53 G0 Y0')"><span class="fas fa-chart-line fg-green icon"></span>Goto Y0 (Machine Coord) (G53 G0 Y0)</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <button class="button light jogbtn" onclick="sendGcode( 'G10 P1 L20 Z0')" style="width: 60px;" data-role="ripple" data-ripple-color="#1ba1e2">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-crosshairs fg-openbuilds" data-fa-transform="shrink-2 down-8 left-12"></i>
                          <span class="fa-layers-text fg-blue" data-fa-transform="down-9 right-8" style="font-weight:900; font-family: Arial; font-size: 12px;">Z</span>
                          <span class="fa-layers-text fg-openbuilds" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">setzero</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <div class="dro">
                        <div class="float-left fg-blue">
                          <span class="fa-layers fa-fw">
                            <span class="fa-layers-text fg-blue" data-fa-transform="right-3">Z</span>
                          <span class="fa-layers-text fg-blue" data-fa-transform="left-18 rotate-270" style="font-family: Arial; font-size: 8px;">WORK</span>
                          </span>
                        </div>
                        <div class="float-right fg-blue" id="zPos" data-editable>0.000</div>
                        <input id="zPosInput" class="m-0 p-0 droInput float-right fg-blue" data-editable="true" />
                      </div>
                    </td>
                    <td>
                      <div class="pos-relative">
                        <button class="button light jogbtn" style="width: 42px;"><i class="fas fa-caret-down fg-openbuilds"></i></button>
                        <ul class="d-menu context drop-shadow drop-right" data-role="dropdown">
                          <li><a href="#" onclick="sendGcode( 'G0 Z0')"><span class="fas fa-chart-line fg-blue icon"></span>Goto Z0 (Work Coord) (G0 Z0)</a></li>
                          <li id="gotoZzeroMpos"><a href="#" onclick="sendGcode( 'G53 G0 Z0')"><span class="fas fa-chart-line fg-blue icon"></span>Goto Z0 (Machine Coord) (G53 G0 Z0)</a></li>
                          <li class="divider"></li>
                          <li><a href="#" onclick="z0probe()"><span class="fas fa-podcast fa-rotate-180 fg-blue icon"></span>Probe Z0 Wizard</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <button class="button light jogbtn" onclick="sendGcode( 'G10 P1 L20 X0 Y0 Z0')" style="width: 60px;" data-role="ripple">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-crosshairs fg-openbuilds" data-fa-transform="shrink-2 down-8 left-18"></i>
                          <span class="fa-layers-text fg-red" data-fa-transform="down-9 right-2" style="font-weight:900; font-family: Arial; font-size: 12px;">X</span>
                          <span class="fa-layers-text fg-green" data-fa-transform="down-9 right-12" style="font-weight:900; font-family: Arial; font-size: 12px;">Y</span>
                          <span class="fa-layers-text fg-blue" data-fa-transform="down-9 right-22" style="font-weight:900; font-family: Arial; font-size: 12px;">Z</span>
                          <span class="fa-layers-text fg-openbuilds" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">setzero</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <div class="pos-relative">
                        <button class="button light jogbtn" style="width: 161px;" data-role="ripple">
                          <span class="fa-layers fa-fw">
                            <i class="fas fa-chart-line fg-openbuilds" data-fa-transform="shrink-2 down-8 left-12"></i>
                            <i class="fas fa-caret-down fg-openbuilds" data-fa-transform="shrink-2 right-70"></i>
                            <span class="fa-layers-text fg-red" data-fa-transform="down-9 right-8" style="font-weight:900; font-family: Arial; font-size: 12px;">X</span>
                            <span class="fa-layers-text fg-green" data-fa-transform="down-9 right-19" style="font-weight:900; font-family: Arial; font-size: 12px;">Y</span>
                            <span class="fa-layers-text fg-blue" data-fa-transform="down-9 right-29" style="font-weight:900; font-family: Arial; font-size: 12px;">Z</span>
                            <span class="fa-layers-text fg-openbuilds" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">gotozero</span>
                          </span>
                        </button>
                        <ul class="d-menu context drop-shadow" data-role="dropdown">
                          <li id="gotozeroWPos"><a href="#"><span class="fas fa-chart-line fg-openbuilds icon"></span>GOTO X0Y0Z0 (Work Coord) (G0 Z5, G0 X0 Y0, G0 Z0) (Retract Z to Work Coord Z5)</a></li>
                          <li id="gotozeroMPos"><a href="#"><span class="fas fa-chart-line fg-openbuilds icon"></span>GOTO X0Y0Z0 (Machine Coord) (G53 G0 Z0, G0 X0 Y0, G0 Z0) (Retract Z to Machine Coord Z0)</a></li>
                        </ul>
                      </div>
                    </td>
                    <td>
                      <div class="pos-relative">
                        <button class="button light jogbtn" style="width: 42px;"></i>
                          <span class="fa-layers fa-fw">
                            <i class="fas fa-layer-group fg-openbuilds" data-fa-transform="shrink-2 up-3"></i>
                            <i class="fas fa-caret-down fg-openbuilds" data-fa-transform="down-8"></i>
                            <!-- <span class="fa-layers-text fg-grayBlue" data-fa-transform="up-8 " style="font-weight:900; font-family: Arial; font-size: 12px;">gotozero</span> -->
                          </span>
                        </button>
                        <ul class="d-menu context drop-shadow drop-right" data-role="dropdown">
                          <li><a href="#" onclick="sendGcode('G28')"><span class="fas fa-layer-group fg-grayBlue icon"></span>Go to Pre-Defined Position (G28)</a></li>
                          <li><a href="#" onclick="sendGcode('G28.1')"><span class="fas fa-tasks fg-grayBlue icon"></span>Set Pre-Defined Position (G28.1)</a></li>
                          <li class="divider"></li>
                          <li><a href="#" onclick="sendGcode('G30')"><span class="fas fa-layer-group fg-grayBlue icon"></span>Go to Pre-Defined Position (G30)</a></li>
                          <li><a href="#" onclick="sendGcode('G30.1')"><span class="fas fa-tasks fg-grayBlue icon"></span>Set Pre-Defined Position (G30.1)</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                </table>
              </div>
              <div class="cell border-left bd-lightGray ">

                <table class="jogtable">
                  <tr>
                    <td>

                    </td>

                    <td>
                      <button class="button light square large jogbtn" id="yP" data-role="ripple" data-ripple-color="#5de21b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-up fg-green" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-green" data-fa-transform="shrink-5 up-8" style="font-weight:600">Y+</span>
                        </span>
                      </button>
                    </td>

                    <td>
                    </td>


                    <td>
                      <button class="button light square large jogbtn" id="zP" data-role="ripple" data-ripple-color="#1ba1e2">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-up fg-blue" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-blue" data-fa-transform="shrink-5 up-8" style="font-weight:600">Z+</span>
                        </span>
                      </button>
                    </td>
                    <td class="servo-active" style="display: none;">
                      <button class="button light square large jogbtn" id="pP" data-role="ripple" data-ripple-color="#1ba1e2">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-pen fg-darkBlue" data-fa-transform="shrink-2 down-8.5"></i>
                          <i class="fas fa-ban fg-red" data-fa-transform="shrink-0.5 down-8.5"></i>
                          <span class="fa-layers-text fg-darkBlue" data-fa-transform="shrink-10 up-12" style="font-weight:600">PEN</span>
                          <span class="fa-layers-text fg-darkBlue" data-fa-transform="shrink-10 up-6" style="font-weight:600">UP</span>
                        </span>
                      </button>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <button class="button light square large jogbtn" id="xM" data-role="ripple" data-ripple-color="#e21b1b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-left fg-red" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-red" data-fa-transform="shrink-5 up-8" style="font-weight:600">X-</span>
                        </span>
                      </button>
                    </td>

                    <td>
                      <button class="button light square large jogbtn" id="yM" data-role="ripple" data-ripple-color="#5de21b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-down fg-green" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-green" data-fa-transform="shrink-5 up-8" style="font-weight:600">Y-</span>
                        </span>
                      </button>
                    </td>

                    <td>
                      <button class="button light square large jogbtn" id="xP" data-role="ripple" data-ripple-color="#e21b1b">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-right fg-red" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-red" data-fa-transform="shrink-5 up-8" style="font-weight:600">X+</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <button class="button light square large jogbtn" id="zM" data-role="ripple" data-ripple-color="#1ba1e2">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-arrow-down fg-blue" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-blue" data-fa-transform="shrink-5 up-8" style="font-weight:600">Z-</span>
                        </span>
                      </button>
                    </td>
                    <td class="servo-active" style="display: none;">
                      <button class="button light square large jogbtn" id="pM" data-role="ripple" data-ripple-color="#1ba1e2">
                        <span class="fa-layers fa-fw">
                          <i class="fas fa-pen fg-darkBlue" data-fa-transform="shrink-2 down-8.5"></i>
                          <span class="fa-layers-text fg-darkBlue" data-fa-transform="shrink-10 up-12" style="font-weight:600">PEN</span>
                          <span class="fa-layers-text fg-darkBlue" data-fa-transform="shrink-10 up-6" style="font-weight:600">DOWN</span>
                        </span>
                      </button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan='5'>
                      <table style="width: 100%;">
                        <tr>
                          <td><span class="text-small">Incremental Jog</span>
                          </td>
                          <td class="pb-1">
                            <label class="toggle">
                              <input type="checkbox" id="jogTypeContinuous"/>
                              <div>app-notifition</div>
                            </label>
                          </td>
                          <td><span class="text-small">Continuous Jog</span>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <button class="button light jogbtn metricbtn distbtn" id="dist01" style="width: 100%; height: 30px; line-height: 28px;">
                        <span class=" fa-layers fa-fw">
                          <span id="dist01label" class="fa-layers-text fg-gray jogdist" data-fa-transform="" style="font-weight:900; font-family: Arial; font-size: 12px;">0.1mm</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <button class="button light jogbtn metricbtn distbtn" id="dist1" style="width: 100%; height: 30px; line-height: 28px;">
                        <span class=" fa-layers fa-fw">
                          <span id="dist1label" class="fa-layers-text fg-gray jogdist" data-fa-transform="" style="font-weight:900; font-family: Arial; font-size: 12px;">1mm</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <button class="button light jogbtn distbtn metricbtn bd-openbuilds" id="dist10" style="width: 100%; height: 30px; line-height: 28px;">
                        <span class=" fa-layers fa-fw">
                          <span id="dist10label" class="fa-layers-text fg-openbuilds jogdist" data-fa-transform="" style="font-weight:900; font-family: Arial; font-size: 12px;">10mm</span>
                        </span>
                      </button>
                    </td>
                    <td>
                      <button class="button light jogbtn distbtn metricbtn" id="dist100" style="width: 100%; height: 30px; line-height: 28px;">
                        <span class=" fa-layers fa-fw">
                          <span id="dist100label" class="fa-layers-text fg-gray jogdist" data-fa-transform="" style="font-weight:900; font-family: Arial; font-size: 12px;">100mm</span>
                        </span>
                      </button>
                    </td>
                  </tr>
                  <tr>
                    <td colspan='5'>
                      <div id="jogratemmdiv">
                        <input id="jograte" type="number" min="100" max="10000" step="500" placeholder="5000" data-role="input" data-prepend="Jog:" data-append="mm/min" data-clear-button="false" value="5000" style="text-align: right;" data-editable="true" />
                      </div>
                      <div id="jograteinchdiv">
                        <input id="jograteinch" type="number" min="1" max="5000" step="10" placeholder="196" data-role="input" data-prepend="Jog:" data-append="in/min" data-clear-button="false" value="196" style="text-align: right;" data-editable="true" />
                      </div>
                    </td>
                  </tr>
                </table>
              </div>

              <div class="cell border-left bd-lightGray" id="frocell">
                <button class="button light mini mb-1" onclick="feedOverride(100);">reset</button>
                <input id="fro" data-on-stop="feedOverride(arguments[0])" data-role="slider" data-accuracy="5" data-vertical="true" data-size="190" data-accuracy="1" data-min="10" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom"
                  data-hint-mask="Feed: $1%" data-cls-hint="bg-light
                        fg-dark shadow-1" data-cls-complete="bg-openbuilds">
              </div>
              <div class="cell border-left bd-lightGray" id="trocell">
                <button class="button light mini  mb-1" onclick="spindleOverride(100);">reset</button>
                <input id="tro" data-on-stop="spindleOverride(arguments[0])" data-role="slider" data-accuracy="5" data-vertical="true" data-size="190" data-accuracy="1" data-min="10" data-max="200" data-value="100" data-hint="true" data-hint-always="true" data-hint-position="bottom"
                  data-hint-mask="Tool: $1%" data-cls-hint="bg-light
                        fg-dark shadow-1" data-cls-complete="bg-openbuilds">
              </div>
            </div>
          </div>
</center>
              
            
!

CSS

              
                body {
  padding: 10px;
}

/* OpenBuilds Navbar for MetroWindows */
.fg-openbuilds {
  color: rgb(74, 78, 81) !important;
}
.bg-openbuilds {
  background-color: rgb(74, 78, 81) !important;
}
.bd-openbuilds {
  border-color: rgb(74, 78, 81) !important;
}

.drotable td, .jogtable td {
  padding: 2px;
  vertical-align: bottom;
}

.drotable button, .dro {
  border: 1px solid lightgray;
}

.jogtable button {
  border: 1px solid lightgray;
}

#frocell button {
  border: 1px solid lightgray;
}

#trocell button {
  border: 1px solid lightgray;
}

.jogbtn:disabled {
  pointer-events:none;
}

.dro {
  display: block;
  text-decoration: none;
  background-color: #f8f8f8;
  color: #a7a7a7;
  width: 161px;
  height: 36px;
  position: relative;
  text-align: right;
  padding-right: 6px;
  padding-left: 6px;
  line-height: 32px;
  font-weight:900;
  font-size: 18px;
  cursor: pointer;
}

.droInput {
  display: block;
  text-decoration: none;
  background-color: #f5f6f7;
  color: #a7a7a7;
  margin: 2px;
  width: 100px;
  height: 34px;
  position: relative;
  text-align: right;
  padding-right: 6px;
  padding-left: 6px;
  line-height: 34px;
  border-radius: 2px;
  border: 1px solid #ddd;
  font-weight:700;
  font-size: 18px;
  cursor: default;
  text-align: right;
  border: none;
  outline: none;
  display:none;
}

.glossybtn:link, .glossybtn:visited {
  display: block;
  text-decoration: none;
  background-color: #f5f6f7;
  color: #a7a7a7;
  margin: 2px;
  width: 53px;
  height: 53.5px;
  position: relative;
  text-align: center;
  line-height: 50px;
  border-radius: 2px;
  border: 1px solid #ddd;
}

.glossybtn:active {
  background: #d5d6d7;
}

.glossybtn:hover {
  text-decoration: none;
  background: rgba(164,206,249, 0.2);
  border: 1px solid rgb(164,206,249);
}​


/* CSS Mini SwitchCheckbox */
/* <label class="toggle">
        <input type="checkbox"/>
        <div>app-notifition</div>
      </label> */
.disappear-from-screen, .toggle input {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
.toggle-component {
  margin-bottom: 3rem;
}
.toggle-component p {
  margin: 0.7rem 0;
}
.toggle {
  display: table;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  margin-bottom: 0px;
}
.toggle input:focus + div {
  text-decoration: underline;
}
.toggle > div {
  cursor: pointer;
  border-radius: 14px;
  width: 36px;
  height: 17px;
  background: white;
  border: 1px solid lightgray;
  user-select: none;
  position: relative;
  transition: 150ms ease-out;
  font-size: 0;
}
.toggle > div:hover {
  box-shadow: 0 0 4px #4a4e51;
}
.toggle > div:before {
  will-change: translate;
  display: block;
  position: absolute;
  top: 2px;
  left: 2px;
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  background: #4a4e51;
  border-radius: 50%;
  transition: 150ms;
}
.toggle input:checked + div {
  background: #fff;
  border-color: #lightgray;
}
.toggle input:checked + div:before {
  color: #4a4e51;
  transform: translateX(19px);
  background: #4a4e51;
}


/* End CSS mini Switch */

              
            
!

JS

              
                var allowContinuousJog = false;
var jogdist = 10;
var safeToUpdateSliders = true;


$(document).ready(function() {
  if (localStorage.getItem('continuousJog')) {
    if (JSON.parse(localStorage.getItem('continuousJog')) == true) {
      $('#jogTypeContinuous').prop('checked', true)
      allowContinuousJog = true;
      $('.distbtn').hide()
    } else {
      $('#jogTypeContinuous').prop('checked', false)
      allowContinuousJog = false;
      $('.distbtn').show();
    }
  }

  $('#jogTypeContinuous').on('click', function() {
    if ($(this).is(':checked')) {
      localStorage.setItem('continuousJog', true);
      allowContinuousJog = true;
      $('.distbtn').hide();
    } else {
      localStorage.setItem('continuousJog', false);
      allowContinuousJog = false;
      $('.distbtn').show();
    }
    // console.log(document.activeElement)
    document.activeElement.blur();
  });
  
  $('#dist01').on('click', function(ev) {
    if (unit == "mm") {
      jogdist = 0.1;
    } else if (unit == "in") {
      jogdist = 0.254;
    }
    $('.distbtn').removeClass('bd-openbuilds')
    $('#dist01').addClass('bd-openbuilds')
    $('.jogdist').removeClass('fg-openbuilds')
    $('.jogdist').addClass('fg-gray')
    $('#dist01label').removeClass('fg-gray')
    $('#dist01label').addClass('fg-openbuilds')
  })

  $('#dist1').on('click', function(ev) {
    if (unit == "mm") {
      jogdist = 1;
    } else if (unit == "in") {
      jogdist = 2.54;
    }
    $('.distbtn').removeClass('bd-openbuilds')
    $('#dist1').addClass('bd-openbuilds')
    $('.jogdist').removeClass('fg-openbuilds')
    $('.jogdist').addClass('fg-gray')
    $('#dist1label').removeClass('fg-gray')
    $('#dist1label').addClass('fg-openbuilds')
  })

  $('#dist10').on('click', function(ev) {
    if (unit == "mm") {
      jogdist = 10;
    } else if (unit == "in") {
      jogdist = 25.4;
    }
    $('.distbtn').removeClass('bd-openbuilds')
    $('#dist10').addClass('bd-openbuilds')
    $('.jogdist').removeClass('fg-openbuilds')
    $('.jogdist').addClass('fg-gray')
    $('#dist10label').removeClass('fg-gray')
    $('#dist10label').addClass('fg-openbuilds')
  })

  $('#dist100').on('click', function(ev) {
    if (unit == "mm") {
      jogdist = 100;
    } else if (unit == "in") {
      jogdist = 254.0;
    }
    $('.distbtn').removeClass('bd-openbuilds')
    $('#dist100').addClass('bd-openbuilds')
    $('.jogdist').removeClass('fg-openbuilds')
    $('.jogdist').addClass('fg-gray')
    $('#dist100label').removeClass('fg-gray')
    $('#dist100label').addClass('fg-openbuilds')
  })

  $('#dist500').on('click', function(ev) {
    jogdist = 500;
    $('.distbtn').removeClass('bd-openbuilds')
    $('#dist500').addClass('bd-openbuilds')
    $('.jogdist').removeClass('fg-openbuilds')
    $('.jogdist').addClass('fg-gray')
    $('#dist500label').removeClass('fg-gray')
    $('#dist500label').addClass('fg-openbuilds')
  })
  
});

function mmtoinchrate() {
  var value = $('#jograte').val();
  var convert = "";
  convert = (value / 25.4).toFixed(2); //converts the value of input(mm) to inch;
  $("#jograteinch").val(convert);
}

function inchtommrate() {
  var value = $('#jograteinch').val();
  var convert = "";
  convert = (value * 25.4).toFixed(2); //converts the value of input(mm) to inch;
  $("#jograte").val(convert);
}

$(document).ready(function() {
  if (localStorage.getItem('unitsMode')) {
    if (localStorage.getItem('unitsMode') == "mm") {
      mmMode()
      $('#mmMode').click()
    } else if (localStorage.getItem('unitsMode') == "in") {
      inMode();
      $('#inMode').click()
    }
  } else {
    // default to inches
    inMode();
    $('#inMode').click()
  }

  $("#jograte").keyup(function() {
    mmtoinchrate()
  });

  $("#jograteinch").keyup(function() {
    inchtommrate()
  });
});

function mmMode() {
  unit = "mm";
  localStorage.setItem('unitsMode', unit);
  $('#dist01label').html('0.1mm')
  $('#dist1label').html('1mm')
  $('#dist10label').html('10mm')
  $('#dist100label').html('100mm')
  if (jogdist == 0.254) {
    jogdist = 0.1
  }
  if (jogdist == 2.54) {
    jogdist = 1
  }
  if (jogdist == 25.4) {
    jogdist = 10
  }
  if (jogdist == 254) {
    jogdist = 100
  }
  $('#jogratemmdiv').show()
  $('#jograteinchdiv').hide()
  inchtommrate();
}

function inMode() {
  unit = "in";
  localStorage.setItem('unitsMode', unit);
  $('#dist01label').html('0.01"')
  $('#dist1label').html('0.1"')
  $('#dist10label').html('1"')
  $('#dist100label').html('10"')
  if (jogdist == 0.1) {
    jogdist = 0.254
  }
  if (jogdist == 1) {
    jogdist = 2.54
  }
  if (jogdist == 10) {
    jogdist = 25.4
  }
  if (jogdist == 100) {
    jogdist = 254
  }
  $('#jogratemmdiv').hide()
  $('#jograteinchdiv').show()
  mmtoinchrate()
}


              
            
!
999px

Console