使用jquery实现的计算器功能

晚上做了一个jQuery的项目,使用jQuery实现了一个简单的计算器功能,可以实现连加,连减,混合计算,括号内优先计算,代码如下:

css部分:

1 <style> 2 .main{ 3 margin: 0 auto; 4 text-align: center; 5 } 6 *{ 7 padding: 0; 8 margin: 0; 9 } 10 table { 11 margin: auto; 12 border-collapse: collapse; 13 14 } 15 span{ 16 display: inline-block; 17 text-align:center; 18 font-size: 30px; 19 width: 404px; 20 height: 100px; 21 background-color: darkgrey; 22 23 } 24 table td{ 25 text-align: center; 26 width: 100px; 27 height: 100px; 28 line-height: 100px; 29 background-color: lightgrey; 30 border:1px solid darkgrey; 31 } 32 </style>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgydyx.html