2022年1月28日

日期时间计算方法

摘要: 1.计算两个日期之间的天数 dateDiff(Date1, Date2){ //Date1和Date2是2022-02-18格式 var aDate, oDate1, oDate2, iDays aDate = Date1.split("-") oDate1 = new Date(aDate[1] 阅读全文

posted @ 2022-01-28 10:59 creatP 阅读(739) 评论(0) 推荐(0) 编辑

2018年12月14日

js控制iframe高度自动撑开

摘要: function changeFrameHeight(){ var ifm= document.getElementById("myiframe"); ifm.height=document.documentElement.clientHeight; } window.onresize=function(){ changeFram... 阅读全文

posted @ 2018-12-14 15:23 creatP 阅读(1073) 评论(0) 推荐(0) 编辑

2018年9月1日

点击除指定元素以外的任意地方隐藏js

摘要: $(document).click(function () { $(".search_box").hide(); }); $(".resultUl").on("click", function (event) { //取消事件冒泡 var e = arguments.callee.caller.arguments[0] ||... 阅读全文

posted @ 2018-09-01 15:19 creatP 阅读(537) 评论(0) 推荐(1) 编辑

2018年5月21日

es6中对象转数组,转map

摘要: //对象转数组let array = Object.keys(userPermission).map(key=> userPermission[key]) console.log(array) userPermission是数据对象 //对象转mapobjToStrMap(obj) { let st 阅读全文

posted @ 2018-05-21 11:37 creatP 阅读(15346) 评论(1) 推荐(0) 编辑

2018年1月30日

JavaScript常用方法(工具类的封装)

摘要: 日期格式化 距离格式化 格式验证 读取url参数 读取全部url参数 初始化评分星星 判断是否是pc端 判断是否为微信端 微信支付签名时间戳,签名随机串 http请求 阅读全文

posted @ 2018-01-30 10:34 creatP 阅读(341) 评论(1) 推荐(3) 编辑

2018年1月11日

h5端提示下载app

摘要: // app下载提示 if (!sessionStorage.getItem("appDownloadTipClosed") && isAndroidOrIphone() && !isYrhApp()) { $("#appDownloadTip").removeClass("mui-hidden"); ... 阅读全文

posted @ 2018-01-11 17:38 creatP 阅读(680) 评论(0) 推荐(0) 编辑

2017年11月30日

web端调百度地图页面

摘要: 在点击进入地图的入口(下面数据是vue渲染的数据) <a class="navigation" v-if="merchant.longitude && merchant.latitude" href="http://api.map.baidu.com/marker?location={{mercha 阅读全文

posted @ 2017-11-30 17:00 creatP 阅读(461) 评论(0) 推荐(0) 编辑

2017年11月14日

前端分享功能

摘要: 用的是百度的分享功能分享 window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniLi... 阅读全文

posted @ 2017-11-14 18:02 creatP 阅读(283) 评论(0) 推荐(0) 编辑

手机注册发送验证码倒计时

摘要: ()这里用的是input做的点击发送验证码<input type="number" class="input" name="mobile" placeholder="手机号" style="border: none"<input class="hui_kuang"style="width: 30%; 阅读全文

posted @ 2017-11-14 17:03 creatP 阅读(352) 评论(0) 推荐(1) 编辑

判断滚动条滑到底部触发事件

摘要: $(document).on("scroll", function () { //真实内容的高度 var pageHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight); //视窗的高度 var viewpo 阅读全文

posted @ 2017-11-14 15:50 creatP 阅读(375) 评论(0) 推荐(1) 编辑

导航