在某些情况下,需要获得用户的DPI。以下方法是用JavaScript实现获取用户的DPI。
function getDPI() {
        var arrDPI = new Array;
        var devicePixelRatio = window.devicePixelRatio || 1;
        var tmpNode = document.createElement("DIV");
        tmpNode.style.cssText = "height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;";
        document.body.appendChild(tmpNode);
        arrDPI[0] = parseInt(tmpNode.o...
	 9年前 (2016-07-02)	 3241℃	 0评论
3喜欢
	
		 此方法为招商银行网上银行对金额进行大写的转换方法。
function ConvertUpperMoney(whole) {
 //金额转换。输入数字字符串,低至分位,高位不为零
    var GBK_unit1 = "分角";
    var GBK_unit2 = "圆拾佰仟";
    var GBK_unit3 = "万拾佰仟"
    var GBK_unit4 = "亿拾佰仟";
    var GBK_num = "零壹贰叁肆伍陆柒捌玖";
    var section1 = "";
    if (whole.length - 2 >= 0) section1 = whole.substr(whole.length - 2, 2);
    else section1 = whole.substr(0, whole.length);
  ...
	 9年前 (2016-07-02)	 1748℃	 0评论
0喜欢
	
		 
<!doctype html>
<html>
  
  <head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript">function shake(id) {
        var style = document.getElementById(id).style,
        p = [4, 8, 4, 0, -4, -8, -4, 0],
        fx = function() {
          style.marginLeft = p.shift() + 'px';
          if (p.length <= 0) {
            style.marginLeft = 0;
  ...
	 9年前 (2016-07-02)	 1883℃	 0评论
1喜欢