致朋友: 

 

 

 

 


  
  感谢你来到 简单天空 。这是我的个人Blog。
 

 

       1,搜索引擎过来的朋友,请使用下面的搜索,资料绝对能找到~~
        2,另为各位博主站长提供合租服务,联系QQ: 574276001
            地址是:http://shop34202471.taobao.com/ 
  祝你使用愉快!

 

 


分类: Html/JS/CSS预览模式: 普通 | 列表

中文字体的英文名称对照表

有时css文件里面用到中文字体的时候由于字体编码的关系要使用到中文字体的英文字体名字.

然而有些中文字体的英文名字却不是那么好记.

 

中文名 英文名 Unicode Unicode 2
Mac OS
华文细黑 STHeiti Light [STXihei] \534E\6587\7EC6\9ED1 华文细黑
华文黑体 STHeiti \534E\6587\9ED1\4F53 华文黑体
华文楷体 STKaiti \534E\6587\6977\4F53 华文楷体
华文宋体 STSong \534E\6587\5B8B\4F53 华文宋体
华文仿宋 STFangsong \534E\6587\4EFF\5B8B 华文仿宋
丽黑 Pro LiHei Pro Medium \4E3D\9ED1 Pro 丽黑 Pro
丽宋 Pro LiSong Pro Light \4E3D\5B8B Pro 丽宋 Pro
标楷体 BiauKai \6807\6977\4F53 标楷体
苹果丽中黑 Apple LiGothic Medium \82F9\679C\4E3D\4E2D\9ED1 苹果丽中黑
苹果丽细宋 Apple LiSung Light \82F9\679C\4E3D\7EC6\5B8B 苹果丽细宋
Windows
新细明体 PMingLiU \65B0\7EC6\660E\4F53 新细明体
细明体 MingLiU \7EC6\660E\4F53 细明体
标楷体 DFKai-SB \6807\6977\4F53 标楷体
黑体 SimHei \9ED1\4F53 黑体
宋体 SimSun \5B8B\4F53 宋体
新宋体 NSimSun \65B0\5B8B\4F53 新宋体
仿宋 FangSong \4EFF\5B8B 仿宋
楷体 KaiTi \6977\4F53 楷体
仿宋_GB2312 FangSong_GB2312 \4EFF\5B8B_GB2312 仿宋_GB2312
楷体_GB2312 KaiTi_GB2312 \6977\4F53_GB2312 楷体_GB2312
微软正黑体 Microsoft JhengHei \5FAE\x8F6F\6B63\9ED1\4F53 微软正黑体
微软雅黑 Microsoft YaHei \5FAE\8F6F\96C5\9ED1 微软雅黑
Office
隶书 LiSu \96B6\4E66 隶书
幼圆 YouYuan \5E7C\5706 幼圆
华文细黑 STXihei \534E\6587\7EC6\9ED1 华文细黑
华文楷体 STKaiti \534E\6587\6977\4F53 华文楷体
华文宋体 STSong \534E\6587\5B8B\4F53 华文宋体
华文中宋 STZhongsong \534E\6587\4E2D\5B8B 华文中宋
华文仿宋 STFangsong \534E\6587\4EFF\5B8B 华文仿宋
方正舒体 FZShuTi \65B9\6B63\8212\4F53 方正舒体
方正姚体 FZYaoti \65B9\6B63\59DA\4F53 方正姚体
华文彩云 STCaiyun \534E\6587\5F69\4E91 华文彩云
华文琥珀 STHupo \534E\6587\7425\73C0 华文琥珀
华文隶书 STLiti \534E\6587\96B6\4E66 华文隶书
华文行楷 STXingkai \534E\6587\884C\6977 华文行楷
华文新魏 STXinwei \534E\6587\65B0\9B4F 华文新魏

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 46

jQuery性能优化指南

1,总是从ID选择器开始继承
 
在jQuery中最快的选择器是ID选择器,因为它直接来自于JavaScript的getElementById()方法。

例如有一段HTML代码:
 

<div id="content">
<form method="post" action="#">
<h2>交通信号灯</h2>
<ul id="traffic_light">
<li><input type="radio" class="on" name="light" value="red" /> 红色</li>
<li><input type="radio" class="off" name="light" value="yellow" /> 黄色</li>
<li><input type="radio" class="off" name="light" value="green" /> 绿色</li>
</ul>
<input class="button" id="traffic_button" type="submit" value="Go" />
</form>
</div>

如果采用下面的选择器,那么效率是低效的。
var traffic_button = $("#content .button");

因为button已经有ID了,我们可以直接使用ID选择器。如下所示:
var traffic_button = $("#traffic_button");

当然 这只是对于单一的元素来讲。如果你需要选择多个元素,这必然会涉及到 DOM遍历和循环,
为了提高性能,建议从最近的ID开始继承。
如下所示:
var traffic_lights = $("#traffic_light input");

 

2,在class前使用tag(标签名)
 

在jQuery中第二快的选择器是tag(标签)选择器( 比如:$("head") )。
跟ID选择器累时,因为它来自原生的getElementsByTagName() 方法。

继续看刚才那段HTML代码:
 

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 114

js最全的正则验证表达式

一般 /^ 开头  $/结尾

JavaScript代码
  1. 整数正则表达式,中文正则表达式,汉字正则表达式,手机正则表达式   
  2.   
  3.   
  4.   js过滤中文   var str="MIANYANG 绵阳";   
  5.            alert(str.replace(/[^\u4E00-\u9FA5]/g, ''));   
  6.   
  7.     intege:"^-?[1-9]\\d*$",                    //整数   
  8.     intege1:"^[1-9]\\d*$",                    //正整数   
  9.     intege2:"^-[1-9]\\d*$",                    //负整数   
  10.     num:"^([+-]?)\\d*\\.?\\d+$",            //数字   
  11.     num1:"^[1-9]\\d*|0$",                    //正数(正整数 + 0)   
  12.     num2:"^-[1-9]\\d*|0$",                    //负数(负整数 + 0)   
  13.     decmal:"^([+-]?)\\d*\\.\\d+$",            //浮点数   
  14.     decmal1:"^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*$",      //正浮点数   
  15.     decmal2:"^-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*)$",  //负浮点数   
  16.     decmal3:"^-?([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0)$",  //浮点数   
  17.     decmal4:"^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0$",   //非负浮点数(正浮点数 + 0)   
  18.     decmal5:"^(-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*))|0?.0+|0$",  //非正浮点数(负浮点数 + 0)   
  19.   
  20.     email:"^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"//邮件   
  21.     color:"^[a-fA-F0-9]{6}$",                //颜色   
  22.     url:"^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$",    //url   
  23.     chinese:"^[\\u4E00-\\u9FA5\\uF900-\\uFA2D]+$",                    //仅中文   
  24.     ascii:"^[\\x00-\\xFF]+$",                //仅ACSII字符   
  25.     zipcode:"^\\d{6}$",                        //邮编   
  26.     mobile:"^(13|15)[0-9]{9}$",                //手机   
  27.     ip4:"^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$",    //ip地址   
  28.     notempty:"^\\S+$",                        //非空   
  29.     picture:"(.*)\\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$",    //图片   
  30.     rar:"(.*)\\.(rar|zip|7zip|tgz)$",                                //压缩文件   
  31.     date:"^\\d{4}(\\-|\\/|\.)\\d{1,2}\\1\\d{1,2}$",                    //日期   
  32.     qq:"^[1-9]*[1-9][0-9]*$",                //QQ号码   
  33.     tel:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",    //电话号码的函数(包括验证国内区号,国际区号,分机号)   
  34.     username:"^\\w+$",                        //用来用户注册。匹配由数字、26个英文字母或者下划线组成的字符串   
  35.     letter:"^[A-Za-z]+$",                    //字母   
  36.     letter_u:"^[A-Z]+$",                    //大写字母   
  37.     letter_l:"^[a-z]+$",                    //小写字母   
  38.     idcard:"^[1-9]([0-9]{14}|[0-9]{17})$"    //身份证   
  39.   
  40.   
  41.   
  42.   
  43. 以下函数调用方式:   
  44.     function check()   
  45.     {   
  46.         var bb = document.getElementById("txt_id").value;//txt_id为文本框的ID   
  47.         alert(ismobile(bb));//ismobile 代表以下任何一个函数名称   
  48.     }   
  49. HTML代码:   
  50.     <input type="text" name="textfield" id="txt_id" />   
  51.     <input type="submit" name="Submit" value="提交" onclick="check()" />   
  52. **************************/   
  53. // 判断输入是否是一个由 0-9 / A-Z / a-z 组成的字符串   
  54. function isalphanumber(str)   
  55. {   
  56.     var result=str.match(/^[a-zA-Z0-9]+$/);   
  57.     if(result==nullreturn false;   
  58.     return true;   
  59. }   
  60.   
  61.   
  62. // 判断输入是否是一个数字--(数字包含小数)--   
  63. function isnumber(str)   
  64. {   
  65.     return !isNaN(str);   
  66. }   
  67.   
  68.   
  69. // 判断输入是否是一个整数   
  70. function isint(str)   
  71. {   
  72.     var result=str.match(/^(-|\+)?\d+$/);   
  73.     if(result==nullreturn false;   
  74.     return true;   
  75. }   
  76.   
  77.   
  78. // 判断输入是否是有效的长日期格式 - "YYYY-MM-DD HH:MM:SS" || "YYYY/MM/DD HH:MM:SS"   
  79. function isdatetime(str)   
  80. {   
  81.     var result=str.match(/^(\d{4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/);   
  82.     if(result==nullreturn false;   
  83.     var d= new Date(result[1], result[3]-1, result[4], result[5], result[6], result[7]);   
  84.     return (d.getFullYear()==result[1]&&(d.getMonth()+1)==result[3]&&d.getDate()==result[4]&&d.getHours()==result[5]&&d.getMinutes()==result[6]&&d.getSeconds()==result[7]);   
  85. }   
  86.   
  87.   
  88. // 检查是否为 YYYY-MM-DD || YYYY/MM/DD 的日期格式   
  89. function isdate(str){   
  90.    var result=str.match(/^(\d{4})(-|\/)(\d{1,2})\2(\d{1,2})$/);   
  91.    if(result==nullreturn false;   
  92.    var d=new Date(result[1], result[3]-1, result[4]);   
  93.    return (d.getFullYear()==result[1] && d.getMonth()+1==result[3] && d.getDate()==result[4]);   
  94. }   
  95.   
  96.   
  97. // 判断输入是否是有效的电子邮件   
  98. function isemail(str)   
  99. {   
  100.     var result=str.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/);   
  101.     if(result==nullreturn false;   
  102.     return true;   
  103. }   
  104.   
  105.   
  106. // 去除字符串的首尾的空格   
  107. function trim(str){   
  108.    return str.replace(/(^\s*)|(\s*$)/g, "");   
  109. }   
  110.   
  111.   
  112. // 返回字符串的实际长度, 一个汉字算2个长度   
  113. function strlen(str){   
  114.    return str.replace(/[^\x00-\xff]/g, "**").length;   
  115. }   
  116.   
  117.   
  118. //匹配中国邮政编码(6位)   
  119. function ispostcode(str)   
  120. {   
  121.     var result=str.match(/[1-9]\d{5}(?!\d)/);   
  122.     if(result==nullreturn false;   
  123.     return true;   
  124. }   
  125. //匹配国内电话号码(0511-4405222 或 021-87888822)   
  126. function istell(str)   
  127. {   
  128.     var result=str.match(/\d{3}-\d{8}|\d{4}-\d{7}/);   
  129.     if(result==nullreturn false;   
  130.     return true;   
  131. }   
  132.   
  133. //校验是否为(0-10000)的整数   
  134. function isint1(str)   
  135. {   
  136.     var result=str.match(/^[0-9]$|^([1-9])([0-9]){0,3}$|^10000$/);   
  137.     if(result==nullreturn false;   
  138.     return true;   
  139. }   
  140.   
  141.   
  142. //匹配腾讯QQ号   
  143. function isqq(str)   
  144. {   
  145.     var result=str.match(/[1-9][0-9]{4,}/);   
  146.     if(result==nullreturn false;   
  147.     return true;   
  148. }   
  149.   
  150.   
  151. //匹配身份证(15位或18位)   
  152. function isidcard(str)   
  153. {   
  154.     var result=str.match(/\d{15}|\d{18}/);   
  155.     if(result==nullreturn false;   
  156.     return true;   
  157. }   
  158. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////   
  159.   
  160. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////   
  161.   
  162. //校验文本是否为空   
  163. function checknull(field,sval)   
  164. {   
  165.     if (field.value =="")   
  166.       {   
  167.         alert("请填写" + sval + "!");   
  168.         field.focus();   
  169.         return false;   
  170.       }   
  171.       return true;   
  172. }   
  173.   
  174.   
  175. //屏蔽输入字符   
  176. /***********************  
  177. 调用方法:      
  178.     在文本框中加上 onkeypress="return checkChar()"  
  179. *************************/  
  180. function checkChar()   
  181. {      
  182.     var keycode = event.keyCode;   
  183.     if(!(keycode>=48&&keycode<=57))   
  184.     {   
  185.         return false;   
  186.     }   
  187. }   
  188.   
  189.   
  190. /***************************************************************************************************************************   
  191. 中国电话号码验证    
  192. 匹配形式如:0511-4405222 或者021-87888822 或者 021-44055520-555 或者 (0511)4405222    
  193. 正则表达式 "((d{3,4})|d{3,4}-)?d{7,8}(-d{3})*"  
  194.   
  195. 中国邮政编码验证    
  196. 匹配形式如:215421    
  197. 正则表达式 "d{6}"  
  198.   
  199. 电子邮件验证    
  200. 匹配形式如:justali@justdn.com    
  201. 正则表达式 "w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*"  
  202.   
  203. 身份证验证    
  204. 匹配形式如:15位或者18位身份证    
  205. 正则表达式 "d{18}|d{15}"  
  206.   
  207. 常用数字验证    
  208. 正则表达式    
  209. "d{n}" n为规定长度    
  210. "d{n,m}" n到m的长度范围   
  211.   
  212. 非法字符验证    
  213. 匹配非法字符如:< > & / ' |   
  214. 正则表达式 [^<>&/|'\]+   
  215.   
  216. 日期验证    
  217. 匹配形式如:20030718,030718    
  218. 范围:1900--2099    
  219. 正则表达式((((19){1}|(20){1})d{2})|d{2})[01]{1}d{1}[0-3]{1}d{1}   
  220.   
  221.   
  222.   
  223. 匹配中文字符的正则表达式: [\u4e00-\u9fa5]   
  224. 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了   
  225.   
  226. 匹配双字节字符(包括汉字在内):[^\x00-\xff]   
  227. 评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)   
  228.   
  229. 匹配空白行的正则表达式:\n\s*\r   
  230. 评注:可以用来删除空白行   
  231.   
  232. 匹配HTML标记的正则表达式:< (\S*?)[^>]*>.*?|< .*? />   
  233. 评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力   
  234.   
  235. 匹配首尾空白字符的正则表达式:^\s*|\s*$   
  236. 评注:可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等),非常有用的表达式   
  237.   
  238. 匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*   
  239. 评注:表单验证时很实用   
  240.   
  241. 匹配网址URL的正则表达式:[a-zA-z]+://[^\s]*   
  242. 评注:网上流传的版本功能很有限,上面这个基本可以满足需求   
  243.   
  244. 匹配帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):^[a-zA-Z][a-zA-Z0-9_]{4,15}$   
  245. 评注:表单验证时很实用   
  246.   
  247. 匹配国内电话号码:\d{3}-\d{8}|\d{4}-\d{7}   
  248. 评注:匹配形式如 0511-4405222 或 021-87888822   
  249.   
  250. 匹配腾讯QQ号:[1-9][0-9]{4,}   
  251. 评注:腾讯QQ号从10000开始   
  252.   
  253. 匹配中国邮政编码:[1-9]\d{5}(?!\d)   
  254. 评注:中国邮政编码为6位数字   
  255.   
  256. 匹配身份证:\d{15}|\d{18}   
  257. 评注:中国的身份证为15位或18位   
  258.   
  259. 匹配ip地址:\d+\.\d+\.\d+\.\d+   
  260. 评注:提取ip地址时有用   
  261.   
  262. 提取信息中的ip地址:    
  263. (\d+)\.(\d+)\.(\d+)\.(\d+)      
  264.   
  265. 提取信息中的中国手机号码:   
  266. (86)*0*13\d{9}      
  267.   
  268. 提取信息中的中国固定电话号码:   
  269. (\(\d{3,4}\)|\d{3,4}-|\s)?\d{8}      
  270.   
  271. 提取信息中的中国电话号码(包括移动和固定电话):   
  272. (\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}      
  273.   
  274. 提取信息中的中国邮政编码:   
  275. [1-9]{1}(\d+){5}      
  276.   
  277. 提取信息中的中国身份证号码:   
  278. \d{18}|\d{15}      
  279.   
  280. 提取信息中的整数:   
  281. \d+      
  282.   
  283. 提取信息中的浮点数(即小数):   
  284. (-?\d*)\.?\d+      
  285.   
  286. 提取信息中的任何数字 :   
  287. (-?\d*)(\.\d+)?    
  288.   
  289. 提取信息中的中文字符串:   
  290. [\u4e00-\u9fa5]*      
  291.   
  292. 提取信息中的双字节字符串 (汉字):   
  293. [^\x00-\xff]*    
  294.   
  295. 提取信息中的英文字符串:   
  296. \w*   
  297. 提取信息中的网络链接:   
  298. (h|H)(r|R)(e|E)(f|F) *= *('|")?(\w|\\|\/|\.)+('|"| *|>)?     
  299.   
  300. 提取信息中的邮件地址:   
  301. \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*    
  302.   
  303. 提取信息中的图片链接:   
  304. (s|S)(r|R)(c|C) *= *('|")?(\w|\\|\/|\.)+('|"| *|>)?   
  305.   
  306.   
  307. 匹配特定数字:   
  308. ^[1-9]\d*$    //匹配正整数   
  309. ^-[1-9]\d*$   //匹配负整数   
  310. ^-?[1-9]\d*$   //匹配整数   
  311. ^[1-9]\d*|0$  //匹配非负整数(正整数 + 0)   
  312. ^-[1-9]\d*|0$   //匹配非正整数(负整数 + 0)   
  313. ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$   //匹配正浮点数   
  314. ^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$  //匹配负浮点数   
  315. ^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$  //匹配浮点数   
  316. ^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$   //匹配非负浮点数(正浮点数 + 0)   
  317. ^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$  //匹配非正浮点数(负浮点数 + 0)   
  318. 评注:处理大量数据时有用,具体应用时注意修正   
  319.   
  320. 匹配特定字符串:   
  321. ^[A-Za-z]+$  //匹配由26个英文字母组成的字符串   
  322. ^[A-Z]+$  //匹配由26个英文字母的大写组成的字符串   
  323. ^[a-z]+$  //匹配由26个英文字母的小写组成的字符串   
  324. ^[A-Za-z0-9]+$  //匹配由数字和26个英文字母组成的字符串   
  325. ^\w+$  //匹配由数字、26个英文字母或者下划线组成的字符串   
  326. 评注:最基本也是最常用的一些表达式   
  327.   
  328.   
  329.   
  330. ////////////////////前4行程序用于保护js代码不被下载   
  331. // ////////////////////基本正则表达式///////////////////    
  332. //非空验证 function NotNull (str) { return (str!=""); }    
  333. //邮件地址验证    
  334. function checkEmail (str) {   
  335.     //邮件地址正则表达式 isEmail1=/^\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w+$/;    
  336.     //邮件地址正则表达式 isEmail2=/^.*@[^_]*$/;    
  337.     //验证邮件地址,返回结果 return (isEmail1.test(str)&&isEmail2.test(str));    
  338.     } //身份证验证 function checkIDCard (str) {    
  339.         //身份证正则表达式(15位)    
  340.         isIDCard1=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;    
  341.         //身份证正则表达式(18位) isIDCard2=/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}$/;    
  342.         //验证身份证,返回结果 return (isIDCard1.test(str)||isIDCard2.test(str)); }    
  343.         //IP验证 function checkIP (str)    
  344.         { //IP正则表达式 IP='(25[0-5]|2[0-4]\\d|1\\d\\d|\\d\\d|\\d)';    
  345.         IPdot=IP+'\\.'; isIPaddress=new RegExp('^'+IPdot+IPdot+IPdot+IP+'$');    
  346.         //验证IP,返回结果 return (isIPaddress.test(str)); }    
  347.         //主页(网址)验证 function checkHomepage (str) {    
  348.             //主页正则表达式 //isHomepage=/^\w+([\.\-]\w)*$/; isHomepage=/^\w+(\.\w+)+\.\w+$/;    
  349.             //验证主页,返回结果 return (isHomepage.test(str)); }    
  350.             //是否数字 function isNum (str) { //isNumber=/^([1-9]\d*(\.\d+)?)|(\d+(\.\d+))$/; isNumber=/^\d+(\.\d+)?$/;    
  351.             //验证并返回结果 return (isNumber.test(str)); }    
  352.             //是否整数 function isInt (str) { isInteger=/^\d+$/;    
  353.             //验证并返回结果 return (isInteger.test(str)); }    
  354.             //是否字母 function isChar (str) { isCharacter=/^[A-Za-z]+$/;    
  355.             //验证并返回结果 return (isCharacter.test(str)); }   

 

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 188

jquery 的gg 翻译插件

点击下载此文件

众人,中文,翻译english
Description
Google Analyticator easily adds Google Analytics tracking support to a WordPress-powered blog. Google Analyticator also comes with an easily customizable widget that can be used to display specific information that is gathered by Google Analytics using the Google Analytics API. It supports all of the tracking mechanisms that Google Analytics supports such as external link tracking, download tracking, tracking without counting administrative users, and any other advanced tracking the user wishes to add. Google Analyticator works with a majority of themes as long as these themes provide the proper plugin hooks.

Google Analyticator was the first Google Analytics tracking plugin for WordPress. It is also now one of the most popular tracking plugins that can be used with WordPress. It is also now the first WordPress plugin using Google Analytics stats to display visitor information on the front-end in the form of a visitor counter. 






 

 

 

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 147

http://www.netzgesta.de/corner/

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 190

用javascript选中select中的option  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 238

240多个JQuery插件  不能演示自行搜索

概述

jQuery 是继 prototype 之后又一个优秀的 Javascript 框架。其宗旨是—写更少的代码,做更多的事情。它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不jquery及的,它兼容 CSS3,还兼容各种浏览器(IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)。 jQuery 是一个快速的,简洁的 javaScript 库,使用户能更方便地处理 HTML documents、events、实现动画效果,并且方便地为网站提供 AJAX 交互。 jQuery 还有一个比较大的优势是,它的文档说明很全,而且各种应用也说得很详细,同时还有许多成熟的插件可供选择。 jQuery 能够使用户的 html 页保持代码和 html 内容分离,也就是说,不用再在 html 里面插入一堆js来调用命令了,只需定义 id 即可。今天在Kollermedia.at上发现了一篇JQuery插件列表的文章,特推荐如下。

文件上传(File upload)JQuery_001

Ajax File Upload.
jQUploader.
Multiple File Upload plugin.
jQuery File Style.
Styling an input type file.
Progress Bar Plugin.

表单验证(Form Validation)

jQuery Validation.
Auto Help.
Simple jQuery form validation.
jQuery XAV - form validations.
jQuery AlphaNumeric.
Masked Input.
TypeWatch Plugin.
Text limiter for form fields.
Ajax Username Check with jQuery.

表单-选取框(Form - Select Box stuff)

jQuery Combobox.
jQuery controlled dependent (or Cascadign) Select List.
Multiple Selects.
Select box manipulation.
Select Combo Plugin.
jQuery - LinkedSelect
Auto-populate multiple select boxes.
Choose Plugin (Select Replacement).

表单基本、输入框、选择框等(Form Basics, Input Fields, Checkboxes etc.)

jQuery Form Plugin.
jQuery-Form.
jLook Nice Forms.
jNice.
Ping Plugin.
Toggle Form Text.
ToggleVal.
jQuery Field Plugin.
jQuery Form’n Field plugin.
jQuery Checkbox manipulation.
jTagging.
jQuery labelcheck.
Overlabel.
3 state radio buttons.
ShiftCheckbox jQuery Plugin.
Watermark Input.
jQuery Checkbox (checkboxes with imags).
jQuery SpinButton Control.
jQuery Ajax Form Builder.
jQuery Focus Fields.
jQuery Time Entry.

时间、日期和颜色选取(Time, Date and Color Picker)

jQuery UI Datepicker.
jQuery date picker plugin.
jQuery Time Picker.
Time Picker.
ClickPick.
TimePicker.
Farbtastic jQuery Color Picker Plugin.
Color Picker by intelliance.fr.

投票插件(Rating Plugins)

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 225

Css 3.0 简体中文 参考手册

 

CSS 3.0 参考手册 (中文版)

版本号:beta1 (最后更新时间:2009-8-22)

很多内容都是IE不支持的,看来明年IE8的继任者IE9会有重大更新。

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 98
JavaScript代码
  1. window.onload= someFunction();//页面报尚未实现错误时不防用下面的试一下   
  2.   
  3. window.onload =   someFunction;    
  4.   
  5. window.onload = function (){someFunction();};    
  6.   
  7. window.onload = Function("someFunction();");      

 

分类:Html/JS/CSS | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 190

投票统计图/进度条

http://www.xij.cn/blog/wp-content/uploads/2008/11/progressbar.html

 

html结构:

做投票统计图,我想到的第一个办法是直接写入图片width值百分比,这是大家最熟悉的,以前都这样做。为了更方便满足需求,后来我统一用了一张空的透明的gif,然后定义图片不同背景background(图片也可以定义背景,甚至背景图,如果背景透明的话)
再后来需求又有升级,设计图进一步美化,已经不能通过拉伸图片来达到效果了,就像上图一样,怎么办?我想了想,然后直接把结构写成了这样:

<ul id="progress">
<li><em>项目1:</em><span class="bar0"><small>70%</small></span></li>
<li><em>项目2:</em><span class="bar1"><small>50%</small></span></li>
<li><em>项目3:</em><span class="bar0"><small>0%</small></span></li>
<li><em>更多项目n:</em><span class="bar1"><small>10%</small></span></li>
</ul>

项目名长短不一,可以加em标签,居右冒号对齐,我喜欢冒号对齐。
span设统一宽度以及灰背景,里面small加居右不循环背景,隐藏里面的text我的常用办法是height:0;padding-top:23px;overflow:hidden;
百分比宽可以直接写在small里,我这里用JS实现了,有个小效果还能更语义化:)

CSS:

#progress{list-style:none;margin:30px 0 0;}
#progress li{height:25px;margin-bottom:10px;line-height:25px;}
#progress em{float:left;text-align:right;width:80px;}
#progress span{float:left;width:200px;height:25px;margin:0 5px;background:#eee;}
#progress span small{display:inline-block;width:0;height:0;padding-top:23px;overflow:hidden;}
#progress .bar0 small{border:#FF66FF 1px solid;background:url(http://www.xij.cn/blog/wp-content/uploads/2008/11/progressbar.gif) right 0 no-repeat;}
#progress .bar1 small{border:#FFCC00 1px solid;background:url(http://www.xij.cn/blog/wp-content/uploads/2008/11/progressbar.gif) right -23px no-repeat;}

Script:

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 205

仿ajax的一种方式 走动的时间 例子

注:这个是在一个CMS系统中看到的~

1、这个是默认走动效果,带星期几的。

XML/HTML代码
  1. <span id="times" center="left" style="color:#ffffff">The Time Is Loading…</span>  
  2.         <script language="javascript" type="text/javascript">  
  3.          setInterval("document.getElementById('times').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);   
  4.         </script>  

 

2、升级一下,比如:一个用户在线时间很长,于是给出闪烁效果的提示

XML/HTML代码
  1. <span id="times" center="left" style="color:#000">The Time Is Loading…</span>  
  2. <script language="javascript" type="text/javascript">  
  3. var online=0;   
  4.  setInterval(function() {   
  5.        document.getElementById('times').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());   
  6.        if(online>5)   
  7.        {   
  8.        if(document.getElementById('times').style.display=='')   
  9.        {   
  10.         document.getElementById('times').style.display="none";   
  11.        }else{document.getElementById('times').style.display='';   
  12.        }   
  13.        }   
  14.        online++;   
  15.                 },1000);   
  16.         </script>  

 

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 2 | 查看次数: 425


    display:block;
    width: 140px;
    overflow: hidden;/*注意不要写在最后了*/
    white-space: nowrap;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 127

font:13px/1.231 arial 的用法和效果

IE 中的字体 small 就是 13px,用 small 是为了解决IE下字体的缩放,因为 px 在 IE 下是不可缩放。原系数 0.9759, 是解决 IE 与其它浏览器 em 换算差异化的。

font 的定义:
/**
* Percents could work for IE, but for backCompat purposes, we are using keywords.
* x-small is for IE6/7 quirks mode.
*/
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}

不好意思,我也是网上找的资料,自己也没理解。。。等待高手

 

font:13px/1.231
字体大小13px
行高1.231
 
 

 

分类:Html/JS/CSS | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 261

今天被在修改CSS的时候,突然碰到要单独Hack IE8的。当然,用注释非常方便,只要添加相应的注释就可以解决。但问题是,为了一句CSS写多一个文件,或者在header上添加注释,那显然不是懒人的习惯做法。结论如下:

selector{
property:value; /* 所有浏览器 */
property:value\9; /* 所有IE浏览器 */
+property:value; /* IE7 */
_property:value; /* IE6 */
}

当然,注意顺序。根据CSS的优先性,上面的写法,分别针对Firefox、IE8、IE7和IE6显示值。让我们看看这个演示

演示的CSS代码如下:

p.ie{
height:60px;text-align:center;line-height:60px;border:1px dashed #bbb;background:#f7f7f7;font:15;
color:blue; // 所有浏览器
color:brown\9; // 所有IE浏览器
+color:red; // IE7
_color:green; // IE6
}

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 136

首先感谢aw5186网友在本站的留言,是他的留言让我意识到了这个误区。

长久以来,我们都口口相传Internet Explorer 6是不支持CSS中的!important属性的,这不仅体验在从一些高手那里传授过来的经验,网络上的教程中,甚至在某些经典教程中都存在这样的认识误区。包括在CSS Matery (作者:Andy Budd等)也没有提及CSS中的!important在Internet Explorer 6中的问题。此书中讲到的CSS Hack技术也使用了我前面那篇文章中的说法。不过,按照我的(或者说是大多数人的)习惯,基本上都不会发现CSS 中的!important会存在问题。

一、Internet Explorer 6 (IE 6)不支持CSS中!important属性由来

我们在CSS中使用!important来区分是否Internet Explorer 6 (IE 6)的写法大体如下:

  1. .a {   
  2.     color:red !important;   
  3.     color:blue;   
  4. }  

在所有非Internet Explorer 6 (IE 6)及以下浏览器中,class属性为a的元素内文字都将显示为红色,而在Internet Explorer 6 (IE 6)中则显示为蓝色,因此我们也经常用这种方法作为CSS Hack技术来区分浏览器。这正是这个广为流传的CSS Hack技术让大多数人觉得Internet Explorer 6 (IE 6)是不支持!important的。
点击查看演示

二、偶然的发现

可能某位Web designer在写CSS代码的时候,已经为某个class写了一段代码,后来忘记了又重新写了一段并使用了!important,于是发现了这个问题(所有的CSS Hack技术几乎都来来自不经意间的发现)。

我们把上面那段简单的代码换一种写法:

  1. .a {color:red !important;}   
  2. .a {color:blue;}  

查看更多...

分类:Html/JS/CSS | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 87