加入收藏 | 设为首页 | 会员中心 | 我要投稿 葫芦岛站长网 (https://www.0429zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > 建站资源 > 优化 > 正文

JavaScript常用工具方法封装

发布时间:2019-02-15 02:49:27 所属栏目:优化 来源:佚名
导读:JavaScript 1. type 类型判断 isString(o){//是否字符串 returnObject.prototype.toString.call(o).slice(8,-1)==='String' } isNumber(o){//是否数字 returnObject.prototype.toString.call(o).slice(8,-1)==='Number' } isBoolean(o){//是否boolean retu

2. Phone-reset

  1. /* normalize.css */ 
  2.  
  3. html { 
  4.   line-height: 1.15; 
  5.   /* 1 */ 
  6.   -ms-text-size-adjust: 100%; 
  7.   /* 2 */ 
  8.   -webkit-text-size-adjust: 100%; 
  9.   /* 2 */ 
  10.  
  11. body { 
  12.   margin: 0; 
  13.  
  14. article, 
  15. aside, 
  16. footer, 
  17. header, 
  18. nav, 
  19. section { 
  20.   display: block; 
  21.  
  22. h1 { 
  23.   font-size: 2em; 
  24.   margin: 0.67em 0; 
  25.  
  26. figcaption, 
  27. figure, 
  28. main { 
  29.   /* 1 */ 
  30.   display: block; 
  31.  
  32. figure { 
  33.   margin: 1em 40px; 
  34.  
  35. hr { 
  36.   box-sizing: content-box; 
  37.   /* 1 */ 
  38.   height: 0; 
  39.   /* 1 */ 
  40.   overflow: visible; 
  41.   /* 2 */ 
  42.  
  43. pre { 
  44.   font-family: monospace, monospace; 
  45.   /* 1 */ 
  46.   font-size: 1em; 
  47.   /* 2 */ 
  48.  
  49. a { 
  50.   background-color: transparent; 
  51.   /* 1 */ 
  52.   -webkit-text-decoration-skip: objects; 
  53.   /* 2 */ 
  54.  
  55. abbr[title] { 
  56.   border-bottom: none; 
  57.   /* 1 */ 
  58.   text-decoration: underline; 
  59.   /* 2 */ 
  60.   text-decoration: underline dotted; 
  61.   /* 2 */ 
  62.  
  63. b, 
  64. strong { 
  65.   font-weight: inherit; 
  66.  
  67. b, 
  68. strong { 
  69.   font-weight: bolder; 
  70.  
  71. code, 
  72. kbd, 
  73. samp { 
  74.   font-family: monospace, monospace; 
  75.   /* 1 */ 
  76.   font-size: 1em; 
  77.   /* 2 */ 
  78.  
  79. dfn { 
  80.   font-style: italic; 
  81.  
  82. mark { 
  83.   background-color: #ff0; 
  84.   color: #000; 
  85.  
  86. small { 
  87.   font-size: 80%; 
  88.  
  89. sub, 
  90. sup { 
  91.   font-size: 75%; 
  92.   line-height: 0; 
  93.   position: relative; 
  94.   vertical-align: baseline; 
  95.  
  96. sub { 
  97.   bottom: -0.25em; 
  98.  
  99. sup { 
  100.   top: -0.5em; 
  101.  
  102. audio, 
  103. video { 
  104.   display: inline-block; 
  105.  
  106. audio:not([controls]) { 
  107.   display: none; 
  108.   height: 0; 
  109.  
  110. img { 
  111.   border-style: none; 
  112.  
  113. svg:not(:root) { 
  114.   overflow: hidden; 
  115.  
  116. button, 
  117. input, 
  118. optgroup, 
  119. select, 
  120. textarea { 
  121.   font-family: sans-serif; 
  122.   /* 1 */ 
  123.   font-size: 100%; 
  124.   /* 1 */ 
  125.   line-height: 1.15; 
  126.   /* 1 */ 
  127.   margin: 0; 
  128.   /* 2 */ 
  129.  
  130. button, 
  131. input { 
  132.   /* 1 */ 
  133.   overflow: visible; 
  134.  
  135. button, 
  136. select { 
  137.   /* 1 */ 
  138.   text-transform: none; 
  139.  
  140. button, 
  141. html [type="button"], 
  142.  
  143. /* 1 */ 
  144.  
  145. [type="reset"], 
  146. [type="submit"] { 
  147.   -webkit-appearance: button; 
  148.   /* 2 */ 
  149.  
  150. button::-moz-focus-inner, 
  151. [type="button"]::-moz-focus-inner, 
  152. [type="reset"]::-moz-focus-inner, 
  153. [type="submit"]::-moz-focus-inner { 
  154.   border-style: none; 
  155.   padding: 0; 
  156.  
  157. button:-moz-focusring, 
  158. [type="button"]:-moz-focusring, 
  159. [type="reset"]:-moz-focusring, 
  160. [type="submit"]:-moz-focusring { 
  161.   outline: 1px dotted ButtonText; 
  162.  
  163. fieldset { 
  164.   padding: 0.35em 0.75em 0.625em; 
  165.  
  166. legend { 
  167.   box-sizing: border-box; 
  168.   /* 1 */ 
  169.   color: inherit; 
  170.   /* 2 */ 
  171.   display: table; 
  172.   /* 1 */ 
  173.   max-width: 100%; 
  174.   /* 1 */ 
  175.   padding: 0; 
  176.   /* 3 */ 
  177.   white-space: normal; 
  178.   /* 1 */ 
  179.  
  180. progress { 
  181.   display: inline-block; 
  182.   /* 1 */ 
  183.   vertical-align: baseline; 
  184.   /* 2 */ 
  185.  
  186. textarea { 
  187.   overflow: auto; 
  188.  
  189. [type="checkbox"], 
  190. [type="radio"] { 
  191.   box-sizing: border-box; 
  192.   /* 1 */ 
  193.   padding: 0; 
  194.   /* 2 */ 
  195.  
  196. [type="number"]::-webkit-inner-spin-button, 
  197. [type="number"]::-webkit-outer-spin-button { 
  198.   height: auto; 
  199.  
  200. [type="search"] { 
  201.   -webkit-appearance: textfield; 
  202.   /* 1 */ 
  203.   outline-offset: -2px; 
  204.   /* 2 */ 
  205.  
  206. [type="search"]::-webkit-search-cancel-button, 
  207. [type="search"]::-webkit-search-decoration { 
  208.   -webkit-appearance: none; 
  209.  
  210.  ::-webkit-file-upload-button { 
  211.   -webkit-appearance: button; 
  212.   /* 1 */ 
  213.   font: inherit; 
  214.   /* 2 */ 
  215.  
  216. details, 
  217.  
  218. /* 1 */ 
  219.  
  220. menu { 
  221.   display: block; 
  222.  
  223. summary { 
  224.   display: list-item; 
  225.  
  226. canvas { 
  227.   display: inline-block; 
  228.  
  229. template { 
  230.   display: none; 
  231.  
  232. [hidden] { 
  233.   display: none; 
  234.  
  235. /* reset */ 
  236.  
  237. html, 
  238. body, 
  239. h1, 
  240. h2, 
  241. h3, 
  242. h4, 
  243. h5, 
  244. h6, 
  245. div, 
  246. dl, 
  247. dt, 
  248. dd, 
  249. ul, 
  250. ol, 
  251. li, 
  252. p, 
  253. blockquote, 
  254. pre, 
  255. hr, 
  256. figure, 
  257. table, 
  258. caption, 
  259. th, 
  260. td, 
  261. form, 
  262. fieldset, 
  263. legend, 
  264. input, 
  265. button, 
  266. textarea, 
  267. menu { 
  268.   margin: 0; 
  269.   padding: 0; 
  270.   box-sizing: border-box; 
  271.  
  272. html, 
  273. body { 
  274.   /* 禁止选中文本 */ 
  275.   -webkit-user-select: none; 
  276.   user-select: none; 
  277.   font: Oswald, 'Open Sans', Helvetica, Arial, sans-serif 
  278.  
  279. /* 禁止长按链接与图片弹出菜单 */ 
  280.  
  281. a, 
  282. img { 
  283.   -webkit-touch-callout: none; 
  284.  
  285. /*ios android去除自带阴影的样式*/ 
  286.  
  287. a, 
  288. input { 
  289.   -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 
  290.  
  291. input[type="text"] { 
  292.   -webkit-appearance: none; 

(编辑:葫芦岛站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!