解决方案 »
- 请教:js 实现平滑滚动字幕
- javascript 多维数组 神奇的疑问
- 老大们救命啊,1.1树用js获取被选中的项的错误
- aralejs/switchable怎么在循环滚动是做到首尾相接
- 简单问题,解决即给分
- 求助event="onload" for="window",这里for为什么?
- 紧急求助:怎么在button按钮里加入一张图片,以及如何让图片作为按钮的背景
- 梅花大姐:为什么当我点击按钮和图片时,选择的日期不能写会呢,我试了一天,帮帮我吧!
- 怎么实现关闭子窗口,刷新父窗口?
- 如何给页面中input type=file加上过滤属性,比如说让它只能浏览HTM文件?
- $在这里是什么意思?我在javascript中怎么查找帮助?
- java脚本在火狐浏览器中不能alert出交互页面 怎么解决啊?
var re = /^LETTER-SPACING\:\s*(\-?\d)pt$/g;
var str = 'LETTER-SPACING: -5pt';
str = str.replace(re,function(){
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(str);
var str = '<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>'
var rule = /LETTER-SPACING\:\s*(\-?\d)pt/g;
rst = str.replace(rule,function(){
alert(arguments[1]);
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(rst);
javascript:
var strObj='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
alert(strObj.replace(/(LETTER-SPACING\:\s*[+-]?)(\d{1,})pt\;/gi,'$1'+(Number('$2')*2)+'pt\;')); void(0);
alert(strObj.replace(/(LETTER-SPACING\:\s*[+-]?)(\d{1,})pt/gi,function(){ return arguments[1]+parseInt(arguments[2])*2 + 'pt'; }));
var str = '<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
var str1 = str.replace(/LETTER-SPACING:\s*(-?\d*)/gi,function(a,p1){return 'LETTER-SPACING:'+Number(p1)*2});
alert(str1);抄袭了一下
javascript:
var strObj='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: -5.2pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
alert(strObj.replace(/(LETTER-SPACING\:\s*[+-]?)([\d\.]{1,})pt\;/gi,function(){return arguments[1]+(Number(arguments[2])*2)+'pt\;';})); void(0);
对不起您了 分太少
而且您那个确实不好用,要不您亲自用长的字符串试下
var re = /^LETTER-SPACING\:\s*(\-?\d)pt$/g;
var str='<P style="TEXT-ALIGN: center; LINE-HEIGHT: 55pt; mso-line-height-rule: exactly" class=MsoNormal align=center><SPAN style="FONT-FAMILY: 华文新魏; LETTER-SPACING: 5pt; COLOR: red; FONT-SIZE: 43pt; mso-font-kerning: 5.0pt">能在自己的航海图上标注上之前成功的船队的航行路线<SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>';
str = str.replace(re,function(){
return "LETTER-SPACING:" + 2*parseInt(arguments[1]) + "pt"
});
alert(str);