mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
add mobile check
This commit is contained in:
+2
-2
@@ -7,10 +7,10 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
<input id="text1" type="number" readonly="readonly" style="height:28px;width:98%;outline:none;border:1px solid #1AB6FF;padding-left:3px;"/>
|
<input id="text1" type="number" style="height:28px;width:98%;outline:none;border:1px solid #1AB6FF;padding-left:3px;"/>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<input id="text2" type="number" readonly="readonly" style="height:28px;width:98%;outline:none;border:1px solid #1AB6FF;padding-left:3px;"/>
|
<input id="text2" type="number" style="height:28px;width:98%;outline:none;border:1px solid #1AB6FF;padding-left:3px;"/>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="keyboard.js"></script>
|
<script type="text/javascript" src="keyboard.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
+9
-3
@@ -18,6 +18,7 @@
|
|||||||
var fontSize = options && options.fontSize || '15px';
|
var fontSize = options && options.fontSize || '15px';
|
||||||
var backgroundColor = options && options.backgroundColor || '#fff';
|
var backgroundColor = options && options.backgroundColor || '#fff';
|
||||||
var TABLE_ID = options && options.table_id || 'table_0909099';
|
var TABLE_ID = options && options.table_id || 'table_0909099';
|
||||||
|
var mobile = typeof orientation !== 'undefined';
|
||||||
|
|
||||||
this.el.id = DIV_ID;
|
this.el.id = DIV_ID;
|
||||||
this.el.style.position = 'absolute';
|
this.el.style.position = 'absolute';
|
||||||
@@ -33,7 +34,9 @@
|
|||||||
var cssStr = '<style type="text/css">';
|
var cssStr = '<style type="text/css">';
|
||||||
cssStr += '#' + TABLE_ID + '{text-align:center;width:100%;height:160px;border-top:1px solid #CECDCE;background-color:#FFF;}';
|
cssStr += '#' + TABLE_ID + '{text-align:center;width:100%;height:160px;border-top:1px solid #CECDCE;background-color:#FFF;}';
|
||||||
cssStr += '#' + TABLE_ID + ' td{width:33%;border:1px solid #ddd;border-right:0;border-top:0;}';
|
cssStr += '#' + TABLE_ID + ' td{width:33%;border:1px solid #ddd;border-right:0;border-top:0;}';
|
||||||
// cssStr += '#' + TABLE_ID + ' td:hover{background-color:#1FB9FF;color:#FFF;}';
|
if(!mobile){
|
||||||
|
cssStr += '#' + TABLE_ID + ' td:hover{background-color:#1FB9FF;color:#FFF;}';
|
||||||
|
}
|
||||||
cssStr += '</style>';
|
cssStr += '</style>';
|
||||||
|
|
||||||
//Button
|
//Button
|
||||||
@@ -70,8 +73,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.el.onclick = addEvent;
|
if(mobile){
|
||||||
this.el.ontouchstart = addEvent;
|
this.el.ontouchstart = addEvent;
|
||||||
|
}else{
|
||||||
|
this.el.onclick = addEvent;
|
||||||
|
}
|
||||||
body.appendChild(this.el);
|
body.appendChild(this.el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user