JS实现本地预览上传图片并获取宽高
摘要:<input type="file" accept="image/jpg,image/jpeg,image/png" name="file" onchange="selectImg(this)"> <br> <img id="showImg" src="" alt="" width=""> func
阅读全文
posted @
2022-11-15 09:25
limonyun
阅读(1386)
推荐(0)
js localStorage
摘要:function get_user() { return localStorage.getItem("token") || 0;} function set_user(token) { localStorage.setItem('token',token)}
阅读全文
posted @
2022-05-19 17:14
limonyun
阅读(65)
推荐(0)
语言代码缩写
摘要:语言代码缩写表大全 注意大小写:全部小写!! af 南非公用荷兰语 sq 阿尔巴尼亚语 ar-sa 阿拉伯语(沙特阿拉伯) ar-iq 阿拉伯语(伊拉克) ar-eg 阿拉伯语(埃及) ar-ly 阿拉伯文(利比亚) ar-dz 阿拉伯文(阿尔及利亚) ar-ma 阿拉伯语(摩洛哥) ar-tn 阿
阅读全文
posted @
2022-04-08 20:11
limonyun
阅读(271)
推荐(0)
clipboard复制隐藏域
摘要:<div style="text-align: center;font-size: 0.213333rem;" class="btn" link-url="http://www.baidu.com">点我复制分享链接</div> <script type="text/javascript"> win
阅读全文
posted @
2021-12-19 14:59
limonyun
阅读(135)
推荐(0)
h5压缩图片并生成base64
摘要:function base64ThumbImage(elementObj,maxWidth,maxHeight){ if (typeof (FileReader) 'undefined') { alert("抱歉,你的浏览器不支持发送图片,请升级浏览器或切换浏览器再试!"); } else { tr
阅读全文
posted @
2021-12-14 17:01
limonyun
阅读(515)
推荐(0)
h5只调用摄像头不调用相册
摘要:<input type="file" accept="image/*" id="demo_input" capture="camera" />
阅读全文
posted @
2021-12-13 23:11
limonyun
阅读(364)
推荐(0)
使用 FormData 进行 Ajax 请求并上传文件
摘要:<form id="uploadForm"> <p>上传文件:<input type="file" name="file" /></p> <input type="button" value="上传" onclick="upload()" /> </form> function upload() {
阅读全文
posted @
2021-06-30 15:51
limonyun
阅读(658)
推荐(0)
原生js——控制ios设备在微信打开网页时,自动播放音乐
摘要:<audio id="bg-music" src="1.mp3" autoplay="autoplay" controls></audio> // DOM中的内容加载完毕之后,调用函数 document.addEventListener('DOMContentLoaded', musicInWeix
阅读全文
posted @
2021-05-06 19:30
limonyun
阅读(336)
推荐(0)
微信浏览器拖动出现黑色/白色背景、网址问题解决方案
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, us
阅读全文
posted @
2020-11-29 23:36
limonyun
阅读(455)
推荐(0)
layui弹出层置顶弹出
摘要:在layui中两个或两个以上的弹出层,覆盖前一个弹出层(置顶弹出)用parent.layer.open parent.layer.open({ type : 2, title : '详情', area : ['580px','505px' ], //宽高 closeBtn : 1, scrollba
阅读全文
posted @
2020-11-19 11:50
limonyun
阅读(888)
推荐(0)
使用layui时,ajax执行后,重新渲染页面的方法
摘要:$.ajax({ url : url, type : 'get', dataType:'json', success : function(data) { //重新渲染页面元素 layui.use('element', function() { var element = layui.element
阅读全文
posted @
2020-11-18 17:12
limonyun
阅读(1696)
推荐(0)
js 播放音频文件 兼容火狐 谷歌浏览器
摘要:var url='/js/634.ogg'; window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext; try
阅读全文
posted @
2020-05-15 10:03
limonyun
阅读(746)
推荐(0)
JQuery频繁修改select的选中时的失效问题
摘要:解决方法: 需要将attr换成prop if(designis_lunbo){ $("#lunboture").prop('selected', 'true'); }else{ $("#lunbofalse").prop('selected', 'true'); }
阅读全文
posted @
2018-11-17 14:04
limonyun
阅读(204)
推荐(0)
JS判断当前URL对当前链接高亮显示
摘要:Home 商场管理 商户查询 我的信息 退出系统
阅读全文
posted @
2018-03-10 16:29
limonyun
阅读(352)
推荐(0)
ueditor不过滤保存html
摘要:function isText(node, arr) { if(node.parentNode.tagName == 'pre'){ //源码模式下输入html标签,不能做转换处理,直接输出 arr.push(node.data) }else{ // arr.push(notTransTagName
阅读全文
posted @
2017-12-28 10:24
limonyun
阅读(567)
推荐(0)
js 购物车放大缩小动画
摘要:如果不是动作触发的话,就要注意,每次触发一次都要删掉该class,可以延迟1-2秒删除
阅读全文
posted @
2017-11-16 15:24
limonyun
阅读(341)
推荐(0)
Ecshop js实现飞入购物车效果
摘要:如果需要循环的话,在后面加参数就行 但购物车一般是ajax,像ecshop是ajax.call方法,成功后执行js方法,所以上述操作是获取不了鼠标事件的,所以要做些修改;
阅读全文
posted @
2017-11-16 15:18
limonyun
阅读(294)
推荐(0)