<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>js苹果手机端计算器代码 - 【更多源码:www.96flw.com】</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script>
(function (selector) {
var resizeEvt = 'onorientationchange' in window ? 'orientationchange' : 'resize';
var calcREM = function(base, min, max, scaling) {
var docEl = document.documentElement;
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
clientWidth = Math.max(min, Math.min(clientWidth, max));
docEl.style.fontSize = scaling * (clientWidth / base) + 'px';
}
var resize = function () {
calcREM(375, 300, document.querySelector(selector).clientWidth, 100);
};
if (!document.addEventListener) return;
window.addEventListener(resizeEvt, resize);
document.addEventListener('DOMContentLoaded', resize);
})('.calculator');
</script>
</head>
<body>
<div class="calculator">
<div class="calc-screen">
<div class="calc-result"><span class="data">0</span></div>
</div>
<div class="calc-buttons">
<input type="button" class="buttons" value="AC">
<input type="button" class="buttons" value="←">
<input type="button" class="buttons" value="%">
<input type="button" class="buttons" value="÷">
<input type="button" class="buttons" value="7">
<input type="button" class="buttons" value="8">
<input type="button" class="buttons" value="9">
<input type="button" class="buttons" value="×">
<input type="button" class="buttons" value="4">
<input type="button" class="buttons" value="5">
<input type="button" class="buttons" value="6">
<input type="button" class="buttons" value="-">
<input type="button" class="buttons" value="1">
<input type="button" class="buttons" value="2">
<input type="button" class="buttons" value="3">
<input type="button" class="buttons" value="+">
<input type="button" class="buttons" value="±">
<input type="button" class="buttons" value="0">
<input type="button" class="buttons" value=".">
<input type="button" class="buttons equals" value="=">
</div>
</div>
<script type="text/javascript" src="js/app.js"></script>
<script>
Calculator({
el: '.calculator',
buttons: '.calc-buttons',
output: '.calc-result>.data'
});
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
js苹果手机端计算器代码.zip (3个子文件)
jiaoben7031
js
app.js 6KB
css
style.css 2KB
index.html 3KB
共 3 条
- 1
资源评论
码云笔记
- 粉丝: 2w+
- 资源: 5851
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功