会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
隔壁家的老王头
博客园
首页
新随笔
联系
订阅
管理
2023年5月8日
js,jquery吸顶实现与问题解决
摘要: 一.原生js实现吸顶效果 scrollTop属性:元素的最顶部到窗口顶边的距离。即是滚动条滚动的距离 offsetTop属性:元素到其父层顶部的距离。不能对其进行赋值。设置元素到页面顶部的距离请用style.top属性。 var navBar = document.getElementById("#
阅读全文
posted @ 2023-05-08 13:57 隔壁家的老王头
阅读(240)
评论(0)
推荐(0)
2023年5月5日
js正则表达式清除指定标签外所有标签
摘要: 除了strong、em、p标签,其他标签全部清除: str = str.replace(/<(?!\/?strong|\/?em|\/?p)[^<>]*>/ig,'')
阅读全文
posted @ 2023-05-05 16:51 隔壁家的老王头
阅读(37)
评论(0)
推荐(0)
2022年2月16日
输入校验
摘要: //只能输入数字且保留2位小数(可正可负) function changeNum(obj) { if(isNaN(obj.value) && !/^-$/.test(obj.value)){ obj.value=""; } if(!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(ob
阅读全文
posted @ 2022-02-16 17:31 隔壁家的老王头
阅读(50)
评论(0)
推荐(0)
2021年3月29日
vue环境搭建
摘要: 一,首先要安装node.js node下载地址:https://nodejs.org/zh-cn/download/ 根据自己的的电脑系统选择版本下安装。 查看是否安装成功:npm -v 淘宝镜像:npm install -g cnpm --registry=https://registry.npm
阅读全文
posted @ 2021-03-29 23:06 隔壁家的老王头
阅读(53)
评论(0)
推荐(0)
2019年8月13日
禁止input输入框历史记录
摘要: <input type="text" autocomplete="off" />
阅读全文
posted @ 2019-08-13 12:08 隔壁家的老王头
阅读(489)
评论(0)
推荐(0)
2019年8月12日
jq each遍历数组或对象
摘要: var arr = ["北京","上海","天津","重庆","河北","河南","安徽","湖北","湖南"]; $.each(arr, function(i, val) { console.log(i+"-- --"+val); }); var obj= {name:"小明",male:"男"}
阅读全文
posted @ 2019-08-12 18:08 隔壁家的老王头
阅读(2834)
评论(0)
推荐(0)
2019年6月12日
css控制文本内容显示省略号
摘要: 1,单行文字显示省略号 div{ width:200px; overflow:hideen; white-space:nowrap; text-overflow:ellipsis; } 2,多行文字显示省略号 div{ width:200px; overflow:hideen; text-overf
阅读全文
posted @ 2019-06-12 10:41 隔壁家的老王头
阅读(3394)
评论(0)
推荐(0)
公告