网页版精美计算器代码分享,这个计算器样式很漂亮,可参考这个计算器js代码结合自身网站布局自己做一个。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>完美实用网页计算器js特效代码_武鸣人</title> <style> body,div,p,ul,li,input{margin:0;padding:0;} ul{list-style-type:none;} a{color:#fff;outline:none;text-decoration:none;} body{font:700 24px/1.5 Arial;} #www_wuming_ren{position:relative;width:300px;background:#000;margin:10px auto;} #www_wuming_ren p{color:#fff;text-align:right;font:12px/20px Arial;padding:0 5px;} #www_wuming_ren .f-text{border:0;width:290px;height:84px;text-align:right;font:700 50px/84px Arial;background:url(/img/20240224_www_wuming_ren_4.jpg) repeat-x;padding:0 5px;} #www_wuming_ren ul{position:relative;overflow:hidden;zoom:1;background:url(/img/20240224_www_wuming_ren_6.jpg);padding:0 0 17px 8px;} #www_wuming_ren ul li{float:left;width:63px;height:41px;margin:17px 10px 0 0;} #www_wuming_ren ul li a{display:block;width:63px;height:41px;line-height:41px;text-align:center;background:url(/img/20240224_www_wuming_ren_5.png) no-repeat;} #www_wuming_ren ul li a:hover{background-position:-63px 0;} #www_wuming_ren ul li.btn-1 a{background-position:0 -41px;} #www_wuming_ren ul li.btn-1 a:hover{background-position:-63px -41px;} #www_wuming_ren ul li.btn-2{position:absolute;top:174px;right:0;height:99px;} #www_wuming_ren ul li.btn-2 a{height:99px;line-height:99px;background-position:0 -164px;} #www_wuming_ren ul li.btn-2 a:hover{background-position:-63px -164px;} #www_wuming_ren ul li.btn-3{width:136px;} #www_wuming_ren ul li.btn-3 a{width:136px;background-position:0 -82px;} #www_wuming_ren ul li.btn-3 a:hover{background-position:0 -123px;} #wuming_ren{position:absolute;top:20px;background:none;border:0;font:700 12px/1.5 Arial;width:280px;padding:3px 15px 0 5px;text-align:right;} </style> <script> window.onload = function () {//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var oCalc = document.getElementById("www_wuming_ren"); var aA = oCalc.getElementsByTagName("a"); var aInput = oCalc.getElementsByTagName("input")[0]; var oFormula = document.getElementById("wuming_ren"); var s = false; var i = 0; for (i = 0; i < aA.length; i++){ aA[i].onfocus = function () { this.blur() }; aA[i].onclick = function () { switch(this.innerHTML) { case "c": aInput.value = 0; oFormula.value = ""; break; case "%": count("%") break; case "÷": count("/") break; case "×": count("*") break; case "-": count("-") break; case "+": count("+") break; case "=": s || (oFormula.value += aInput.value); aInput.value = eval(oFormula.value.replace(/\%\/\*\-\+/,'')); aInput.value = aInput.value.substr(0,10).replace("NaN",0); s = true; break; case ".": if(aInput.value.search(/[\.\%\/\*\-\+]/) != -1) break; default: s && (aInput.value = 0, oFormula.value = "", s = false); aInput.value.length < 10 && (aInput.value = (aInput.value + this.innerHTML).replace(/^[0\%\/\*\-\+](\d)/,"$1")); } } } //武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function count(a) { if(s) { oFormula.value = aInput.value + a; aInput.value = a; s = false; } else { /[\%\/\*\-\+]$/.test(aInput.value) || (oFormula.value += aInput.value); aInput.value = a; /[\%\/\*\-\+]$/.test(oFormula.value) || (oFormula.value += aInput.value); oFormula.value = oFormula.value.slice(-1) != a ? oFormula.value.replace(/.$/,a) : oFormula.value } } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <div id="www_wuming_ren"> <p>武鸣人,记录生活点滴,越努力越幸运</p> <input class="f-text" type="text" readonly="readonly" maxlength="9" value="0" /> <ul> <li class="btn-1"><a href="javascript:void(0)">c</a></li> <li class="btn-1"><a href="javascript:void(0)">%</a></li> <li class="btn-1"><a href="javascript:void(0)">÷</a></li> <li class="btn-1"><a href="javascript:void(0)">×</a></li> <li><a href="javascript:void(0)">7</a></li> <li><a href="javascript:void(0)">8</a></li> <li><a href="javascript:void(0)">9</a></li> <li class="btn-1"><a href="javascript:void(0)">-</a></li> <li><a href="javascript:void(0)">4</a></li> <li><a href="javascript:void(0)">5</a></li> <li><a href="javascript:void(0)">6</a></li> <li class="btn-1"><a href="javascript:void(0)">+</a></li> <li><a href="javascript:void(0)">1</a></li> <li><a href="javascript:void(0)">2</a></li> <li><a href="javascript:void(0)">3</a></li> <li class="btn-2"><a href="javascript:void(0)">=</a></li> <li class="btn-3"><a href="javascript:void(0)">0</a></li> <li><a href="javascript:void(0)">.</a></li> </ul> <input id="wuming_ren" type="text" readonly="readonly" value="" /> </div> </body> </html>
本文来自武鸣人网站,转载请注明出处