07 2020 档案

摘要:创建全局命名空间 (function () { /** * FCZX.foo.bar */ let FCZX = {}; FCZX.globalNamespace = function (ns) { var nsParts = ns.split("."); var root = window; fo 阅读全文
posted @ 2020-07-29 18:38 Nyan 阅读(207) 评论(0) 推荐(0) 编辑
摘要:// 倒计时intDiff倒计时总秒数 function timeCountDown(intDiff, showElement) { setInterval(function () { let day = 0; let hour = 0; let minute = 0; let second = 0 阅读全文
posted @ 2020-07-23 21:10 Nyan 阅读(486) 评论(0) 推荐(0) 编辑
摘要:Unicode 是字体在网页端最原始的应用方式,特点是: 兼容性最好,支持 IE6+,及所有现代浏览器。 支持按字体的方式去动态调整图标大小,颜色等等。 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。 注意:新版 iconfont 支持多色图标,这些多色 阅读全文
posted @ 2020-07-22 10:59 Nyan 阅读(1192) 评论(0) 推荐(0) 编辑
摘要:baidu API 引入: <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=***"></script> <script type="text/javascript" src="//api.map.baidu. 阅读全文
posted @ 2020-07-20 18:04 Nyan 阅读(2028) 评论(2) 推荐(0) 编辑
摘要:processData: false, 将数据转换成对象,不对数据做处理,故 processData: false contentType: false, 不设置数据类型 /** * url, data, type, done, pagination * isFile 是否上传文件 */ app.r 阅读全文
posted @ 2020-07-18 10:27 Nyan 阅读(188) 评论(0) 推荐(0) 编辑
摘要:(function () { $.MsgModal = { Alert: function (title, message, okText = '确定') { GenerateHtml("alert", title, message, okText); btnOk(); btnNo(); }, Co 阅读全文
posted @ 2020-07-17 18:04 Nyan 阅读(292) 评论(0) 推荐(0) 编辑
摘要:格式化:timestamp //@fmt 'yy-MM-dd hh:mm:ss' function formatTimeStamp(timestamp, fmt) { var date = new Date(timestamp * 1000); var o = { "M+": date.getMon 阅读全文
posted @ 2020-07-16 16:12 Nyan 阅读(273) 评论(0) 推荐(0) 编辑
摘要:function backToTop() { let toTopBtn = $('#toTopBtn'); let scrollTop = $(document).scrollTop(); let clientHeight = document.documentElement.clientHeigh 阅读全文
posted @ 2020-07-15 09:40 Nyan 阅读(125) 评论(0) 推荐(0) 编辑
摘要:比较图片宽高是否超出父元素的宽高,没有超过直接设置图片本身宽高,超过的话,计算比率父元素宽或高比图片的宽或高,乘以图片宽或高 function resizeImage(imgElement, maxWidth, maxHeight) { let ratio = 0; let width = imgE 阅读全文
posted @ 2020-07-14 16:37 Nyan 阅读(572) 评论(0) 推荐(0) 编辑
摘要:function inputListener(inputElement, maxLength) { let flag = true; inputElement.on('compositionstart', function () { flag = false; }); inputElement.on 阅读全文
posted @ 2020-07-14 15:17 Nyan 阅读(627) 评论(0) 推荐(0) 编辑
摘要:(function (win) { function CustomCarousel(params) { this._init(params) } $.extend(CustomCarousel.prototype, { _init: function (params) { let _this = t 阅读全文
posted @ 2020-07-10 18:47 Nyan 阅读(299) 评论(0) 推荐(0) 编辑
摘要:实现目标如图: js: let listSelector = '.sand-info-list'; let leftSelector = '#sandArrowPrev'; let rightSelector = '#sandArrowNext'; let totalItemCount = $('. 阅读全文
posted @ 2020-07-10 18:46 Nyan 阅读(260) 评论(0) 推荐(0) 编辑
摘要:1、获取url参数 getUrlParam = function (string) { var reg = new RegExp("(^|&)" + string + "=([^&]*)(&|$)"); var d = window.location.href.split('?'); if (d.l 阅读全文
posted @ 2020-07-09 12:23 Nyan 阅读(331) 评论(0) 推荐(0) 编辑
摘要:html: <div class="calculator-condition"> <p class="sub-title">计算条件</p> <div class="select-item"> <label class="select-label fl">选择户型</label> <div clas 阅读全文
posted @ 2020-07-08 11:23 Nyan 阅读(307) 评论(0) 推荐(0) 编辑
摘要:.fullscreen { position: fixed; top: 0; left: 0; margin: 0 auto; width: 100%; height: 100%; background-color: #1a1a1a; } .screen-content { width: 95%; 阅读全文
posted @ 2020-07-03 19:43 Nyan 阅读(355) 评论(0) 推荐(0) 编辑
摘要:1、Math.round() “四舍五入”, 该函数返回的是一个四舍五入后的的整数 long round1 = Math.round(3.1415926); // 结果 3 long round2 = Math.round(18.58); // 结果 19 long round3 = Math.ro 阅读全文
posted @ 2020-07-02 17:16 Nyan 阅读(233) 评论(0) 推荐(0) 编辑
摘要:实现效果: map.js: (function (win) { function SurroundMap(mapId, lng, lat, searchCallback, options = {}) { // 创建Map实例 let _this = this; let map = new BMap. 阅读全文
posted @ 2020-07-01 16:06 Nyan 阅读(2138) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示