- 博客(14)
- 收藏
- 关注
转载 监听页面加载
document.onreadystatechange=function(){ if(document.readystate=='complete'){ // 加载完成执行操作;; } } 转载于:https://www.cnblogs.com/earnest/p/8098856.html...
2017-12-24 18:47:00
300
转载 当input中的type值为file时,各浏览器的表现形式不同
如果想使各浏览器下的表现形式相同,需要对该input元素隐藏,然后再改元素下方添加标签。其html写法如下 <div class="input-file"> <input type="file" name="postImg" value="上传图片" id="upload" class="file-button"> <label class="fil...
2017-09-27 19:24:00
245
转载 关于禁止浏览器的回退功能
//禁止浏览器的回退功能; $(function() { if (window.history && window.history.pushState) { $(window).on('popstate', function () { window.history.pushState('forward', ...
2017-09-19 10:25:00
305
转载 实时监听输入框值变化的完美方案:oninput & onpropertychange
oninput 是HTML5的标准事件,对于检测textarea, input:text, input:password 和 input:search 这几个元素通过用户界面发生的内容变化非常有用,在内容修改后立即被触发,不像 onchange 事件需要失去焦点才触发。oninput事件在主流浏览器的兼容情况如下: 从上面表格可以看出,oni...
2017-09-18 20:26:00
140
转载 Sublime Text 3 快捷键精华版
Sublime Text 3 快捷键精华版 Ctrl+Shift+P:打开命令面板Ctrl+P:搜索项目中的文件Ctrl+G:跳转到第几行Ctrl+W:关闭当前打开文件Ctrl+Shift+W:关闭所有打开文件Ctrl+Shift+V:粘贴并格式化Ctrl+D:选择单词,重复可增加选择下一个相同的单词Ctrl+L:选择行,重复可依次增加选择下一行Ctrl+Shift+L:选择多行Ctr...
2017-09-18 11:28:00
107
转载 计算手动输入的文本长度
var len=8; //初始长度 for(var i=0;i<sErrType.length;i++){ var sensor = $('<pre>'+sErrType[i]+'</pre>').css({display:'none'}); //会保留...
2017-08-22 14:44:00
149
转载 ie的用户名密码输入框右侧提示去掉
::-ms-clear,::-ms-reveal{display:none;} //用户名 密码 转载于:https://www.cnblogs.com/earnest/p/7411507.html
2017-08-22 14:41:00
167
转载 获取元素定位
绝对位置坐标: $("#elem").offset().top$("#elem").offset().left 相对父元素的位置坐标: $("#elem").position().top$("#elem").position().left 转载于:https://www.cnblogs.com/earnest/p/7081886.html...
2017-06-26 18:26:00
98
转载 select option
option的宽度是不可以改变,不可以通过内联样式修改 可以通过ul li来模拟出select 转载于:https://www.cnblogs.com/earnest/p/7061242.html
2017-06-21 18:45:00
113
转载 js打断点
F12打开调试器 资源sources 找到就是文件 选中需要打断点的行 获得段短点的值:将断点向后执行一步(页面提示的桥状小图标),然后选中上一步需要打断点的值,悬浮在上方的小弹框就会出现该语句的值 箭头的小图标是多个断点之间跳跃 转载于:https://www.cnblogs.com/earnest/p/7053310.html...
2017-06-20 11:11:00
198
转载 回车键搜索兼容性问题
回车键搜索兼容性问题 document.onkeydown = keyDownSearch; function keyDownSearch(e) { // 兼容FF和IE和Opera var theEvent = e || window.event; var code = theEvent.keyCode || theEvent.which || theEvent.char...
2017-03-27 20:35:00
153
转载 购物车
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <script src="js/jquery-1.12.4.js"></script></head>...
2017-02-07 14:56:00
142
转载 正则校验
一:正则去判断输入是否为手机号 function checkSubmitMobil() {if ($("#phoneNum").val() == "") {alert("手机号码不能为空!");//$("#moileMsg")....
2017-02-07 13:59:00
121
转载 canvas 旋转
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"></head><body> <canvas id="myCanvas" style="border:1px solid red" width="300" height="300"&...
2017-01-29 22:42:00
142
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅