摘要:
格式化:timestamp //@fmt 'yy-MM-dd hh:mm:ss' function formatTimeStamp(timestamp, fmt) { var date = new Date(timestamp * 1000); var o = { "M+": date.getMon 阅读全文
摘要:
function backToTop() { let toTopBtn = $('#toTopBtn'); let scrollTop = $(document).scrollTop(); let clientHeight = document.documentElement.clientHeigh 阅读全文
摘要:
比较图片宽高是否超出父元素的宽高,没有超过直接设置图片本身宽高,超过的话,计算比率父元素宽或高比图片的宽或高,乘以图片宽或高 function resizeImage(imgElement, maxWidth, maxHeight) { let ratio = 0; let width = imgE 阅读全文
摘要:
function inputListener(inputElement, maxLength) { let flag = true; inputElement.on('compositionstart', function () { flag = false; }); inputElement.on 阅读全文
摘要:
(function (win) { function CustomCarousel(params) { this._init(params) } $.extend(CustomCarousel.prototype, { _init: function (params) { let _this = t 阅读全文
摘要:
实现目标如图: js: let listSelector = '.sand-info-list'; let leftSelector = '#sandArrowPrev'; let rightSelector = '#sandArrowNext'; let totalItemCount = $('. 阅读全文
摘要:
1、获取url参数 getUrlParam = function (string) { var reg = new RegExp("(^|&)" + string + "=([^&]*)(&|$)"); var d = window.location.href.split('?'); if (d.l 阅读全文
摘要:
html: <div class="calculator-condition"> <p class="sub-title">计算条件</p> <div class="select-item"> <label class="select-label fl">选择户型</label> <div clas 阅读全文
摘要:
.fullscreen { position: fixed; top: 0; left: 0; margin: 0 auto; width: 100%; height: 100%; background-color: #1a1a1a; } .screen-content { width: 95%; 阅读全文
摘要:
1、Math.round() “四舍五入”, 该函数返回的是一个四舍五入后的的整数 long round1 = Math.round(3.1415926); // 结果 3 long round2 = Math.round(18.58); // 结果 19 long round3 = Math.ro 阅读全文