您好,欢迎来到模板无忧!
登录
注册
收藏
搜索
地图
帮助
模板无忧
网页特效
网页模板
CMS模板
PPT模板
简历模板
网页特效
视频教程
网页图标
字体下载
CMS教程
DivCss
网站制作
网站运营
网络编程
服务器
请选择您需要的素材分类 |
不限分类
每日更新
|
TOP排行榜
|
Tag标签
|
充值
无忧首页
网页模板
程序模板
建站教程
视频教程
网页特效
图标素材
字体下载
站长工具
站长问答
关闭顶部
展开顶部
网页特效
菜单导航
图片特效
文本链接
层和布局
页面背景
表单按钮
日期时间
计算转换
键盘鼠标
浏览器
游戏娱乐
综合其它
常用代码
jQuery特效
Prototype
Ajax/JavaScript
ExtJS
CSS特效
在线编辑器
Mootools
HTML
JS广告代码合集
站长工具
站长常用软件
网站综合查询
Alexa排名查询
Google PR查询
域名Whois查询
网站收录查询
友情链接查询
CSS2中文手册
CSS精简优化工具
AI小聚 能写会画
域名
推荐
展开边栏
关闭边栏
网页特效代码
模板无忧
>
网页特效
>
综合其它特效代码
>
收藏
分享
查看评论
综合其它
演示
STRING对象的增强函数_综合其它特效
0/5
1
2
3
4
5
查看演示效果
特效Tag:
函数
对象
添加
织梦DedeCMS视频教程
买空间 租服务器 选网硕互联!
无忧站长工具,百度权重一键全查!
STRING对象的增强函数,您可以先修改部分代码再运行.
<style> body,td,div{font:menu} </style> <script> //code by windy_sk , seasonx@163.net //测字符串实际长度 String.prototype.Tlength = function(){var arr=this.match(/[^\x00-\xff]/ig);return this.length+(arr==null?0:arr.length);} //字符串左取 String.prototype.left = function(num,mode){if(!/\d+/.test(num))return(this);var str = this.substr(0,num);if(!mode) return str;var n = str.Tlength() - str.length;num = num - parseInt(n/2);return this.substr(0,num);} //字符串右取 String.prototype.right = function(num,mode){if(!/\d+/.test(num))return(this);var str = this.substr(this.length-num);if(!mode) return str;var n = str.Tlength() - str.length;num = num - parseInt(n/2);return this.substr(this.length-num);} //字符串包含 String.prototype.GetCount = function(str,mode){return eval("this.match(/("+str+")/g"+(mode?"i":"")+").length");} //字符串去除两端空字符 String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");} String.prototype.Ltrim = function(){return this.replace(/(^\s*)/g, "");} String.prototype.Rtrim = function(){return this.replace(/(\s*$)/g, "");} document.write("'aa啦啦aa'.Tlength() = " + "aa啦啦aa".Tlength()); document.write("<br>"); document.write("'aabbcc'.Tlength() = " + "aabbcc".Tlength()); document.write("<br>"); document.write("'aa啦啦aa'.left(4) = " + "aa啦啦aa".left(4)); document.write("<br>"); document.write("'aa啦啦aa'.left(4,true) = " + "aa啦啦aa".left(4,true)); document.write("<br>"); document.write("'aa啦啦aa'.right(4) = " + "aa啦啦aa".right(4)); document.write("<br>"); document.write("'aa啦啦aa'.right(4,true) = " + "aa啦啦aa".right(4,true)); document.write("<br>"); document.write("'abAcae'.GetCount('a') = " + "abAcae".GetCount("a")); document.write("<br>"); document.write("'abAcae'.GetCount('a',true) = " + "abAcae".GetCount("a",true)); document.write("<br>"); document.write("' abc de '.Ltrim() = " + " abc de ".Ltrim()); document.write("<br>"); document.write("' abc de '.Rtrim() = " + " abc de ".Rtrim()); document.write("<br>"); document.write("' abc de '.Trim() = " + " abc de ".Trim()); </script>
所属频道:
综合其它特效
/
更新时间:2013-01-08
[收藏]
[报错]
[返回列表]
评论加载中....
相关
综合其它特效
:
MD5加密
页面保护 可以禁止某些IP的访问
冻结你的窗口,使窗口无法再响应
鼠标放上就激活链接
密码强弱度检测万能插件
叫你计算机"爬"着工作
仿VB密码
打开网页后即在后台打开无数记事本
输入正确进入密码保护页
一点按钮就会跳出无限窗口,直到耗尽您的资源
输入密码后才能进入页面
弹出无限IE
综合其它特效Rss订阅
特效代码搜索
综合其它特效推荐
退出时的弹出窗口代码,不占用父窗口
Js对联广告代码
jQuery星级评分代码
很酷的拖拽翻页效果JavaScript特效
JavaScript获取鼠标滚轮值,判断滚动方向
查找页面中的字符
从左上角滑开的大幅广告效果
用JS监测鼠标是否移动
记录光临页面次数
会自动逐行上升的文本框
猜你也喜欢看这些
127-jQuery流行广告代码
带平滑过渡效果的Mootools下拉折叠菜单
jQuery Newstickerpro BBC的新闻滚动插件
JS、CSS版比较古老的4张大图广告切换代码
jsscrolling-各种样式的滚动页面效果
196-jquery随机头像TIPS特效代码
jquery树形导航菜单插件制作滑动多级二级下拉菜单展示
117-鼠标移过翻开的JS相册代码
136-猫扑财经频道3屏焦点图切换
243-CCTV首页8屏JS遮罩效果焦点图广告代码
相关链接:
复制本页链接
|
搜索STRING对象的增强函数
特效说明:
综合其它模板
-
STRING对象的增强函数
。
收藏&分享
QQ空间
新浪微博
腾讯微博
人人网
开心网
百度搜藏
复制网址
更多...