This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count = 10; | |
| (function divLoop() { | |
| var first, box; | |
| while (count--) { | |
| if (!first) { | |
| first = box = document.createElement("div"); | |
| } | |
| var inner_box = document.createElement("div"); | |
| box.appendChild(inner_box); | |
| box = inner_box; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>绝对定位垂直居中</title> | |
| <style> | |
| #container { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fullScreen() { | |
| var docElm = document.documentElement; | |
| if (docElm.requestFullscreen) { | |
| docElm.requestFullscreen(); | |
| } else if (docElm.mozRequestFullScreen) { | |
| docElm.mozRequestFullScreen(); | |
| } else if (docElm.webkitRequestFullScreen) { | |
| docElm.webkitRequestFullScreen(); | |
| } else if (docElm.msRequestFullscreen) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>自定义弹窗提示</title> | |
| <style> | |
| #tip { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.all("*", function (req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Credentials", true); | |
| res.header("Access-Control-Allow-Headers", "Content-type"); | |
| res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS,PATCH"); | |
| res.header("Access-Control-Max-Age", 1728000); //预请求缓存20天 | |
| next(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 验证账号 | |
| const checkUserName = (rule, value, callback) => { | |
| if (value === "" || value.trim() === "") { | |
| callback(new Error("请输入账号")); | |
| } else { | |
| callback(); | |
| } | |
| }; | |
| // 验证密码 | |
| const checkPassword = (rule, value, callback) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Ajax(type, url, data, success, fail) { | |
| let data = formatData(data); | |
| // 创建ajax对象 | |
| if (window.XMLHttpRequest) { | |
| xhr = new XMLHttpRequest(); | |
| } else { | |
| // 兼容IE6 | |
| xhr = new ActiveXObject('Microsoft.XMLHTTP'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| formatDate: { | |
| format(date, pattern) { | |
| pattern = pattern || DEFAULT_PATTERN; | |
| return pattern.replace(SIGN_REGEXP, function ($0) { | |
| switch ($0.charAt(0)) { | |
| case 'y': | |
| return padding(date.getFullYear(), $0.length); | |
| case 'M': | |
| return padding(date.getMonth() + 1, $0.length); |
NewerOlder