摘要: 直接上代码 给元素绑定事件先 @mousedown="move" 然后在methods中直接调用就好 move(e){ let odiv = e.target; //获取目标元素 //算出鼠标相对元素的位置 let disX = e.clientX - odiv.offsetLeft; let di 阅读全文
posted @ 2020-07-04 10:15 武向前 阅读(6625) 评论(0) 推荐(1)
摘要: function Time3(left) { if (left == 0) { document.getElementById("kaptchaImg").innerHTML = "获取验证码"; document.getElementById("kaptchaImg").disabled = fa 阅读全文
posted @ 2020-05-13 16:13 武向前 阅读(452) 评论(0) 推荐(0)
摘要: touch-action:none会导致app页面无法滚动 阅读全文
posted @ 2020-05-13 10:27 武向前 阅读(677) 评论(0) 推荐(0)
摘要: self.contents = [{"pageCount":0,"author":"(清)任在陞,(清)李柱明纂修 ","catalogData":"封面=1=1;序=2=1;目录=29=1;图=33=1;卷之一=47=1;卷之二=103=1;图=183=1;","title":"[康熙]平谷县志" 阅读全文
posted @ 2020-05-09 14:41 武向前 阅读(701) 评论(0) 推荐(0)
摘要: var flag = false; $("input[type='text']").on('input', function () { if (!flag) console.log($(this).val()); }).on('compositionstart', function () { fla 阅读全文
posted @ 2020-04-23 11:07 武向前 阅读(7507) 评论(0) 推荐(0)
摘要: 有个接口请求的时候,后台同事需要我这边把一个值base64加密一下,我搜了一下,感觉这个还行,也记录一下 var txt = $.base64.encode(需要加密的值); 主要主要是这个jquery.base64.js jQuery.base64 = ( function( $ ) { var 阅读全文
posted @ 2020-04-17 10:40 武向前 阅读(562) 评论(0) 推荐(0)
摘要: mui最近的项目有个上传照片,和拍照,贴一下代码记录一下 1,上传很简单就是file就行,然后获取上传照片img的src,赋值给img添加src(但是file还可以上传文件,就不能回显了,显示照片那会出现那个img找不到src的样子。不知道有没有什么办法回显,或者有什么别的好的展示方案,希望有留言提 阅读全文
posted @ 2020-04-17 10:35 武向前 阅读(564) 评论(0) 推荐(0)
摘要: var mySwiper = new Swiper(".swiper-container", { autoplay:true, loop : true, slidesPerView: "auto", centeredSlides: true, initialSlide :0, observer: t 阅读全文
posted @ 2020-04-14 16:34 武向前 阅读(943) 评论(0) 推荐(0)
摘要: $('div#carParamAPP').on('click','img',function(){ }); 这样写的click可以处理,js脚本中html()进去的内容,给里面的标签添加点击事件。滑过之类的没有试,应该也可以 阅读全文
posted @ 2020-02-25 16:04 武向前 阅读(251) 评论(0) 推荐(0)
摘要: $("body,html").css({"position":"fixed","overflow-y":"hidden"}); 禁止滑动的时候 $("body,html").css({"position":"static","overflow-y":"scroll"}); 可以滑动的时候 感觉禁止滑 阅读全文
posted @ 2020-02-07 13:20 武向前 阅读(429) 评论(0) 推荐(0)