05 2017 档案

jq计算文本宽
摘要:方法1; 首先在body标签最后添加一个子标签: 复制代码代码如下: <span id="ruler">test</span> 然后添加相应的css代码: 复制代码代码如下: #ruler { visibility: hidden; white-space: nowrap; font-size: 2 阅读全文

posted @ 2017-05-10 19:58 神乐丶 阅读(256) 评论(0) 推荐(0)

字符串长度
摘要:$("input").keyup(function(){ name_length=getLength($(this).val()); console.log(name_length) }) function getLength(str){ return str.replace(/[^\x00-xff 阅读全文

posted @ 2017-05-08 21:16 神乐丶 阅读(131) 评论(0) 推荐(0)

导航