JS分类下的博客

www.zady.com/comingsoon

piaoling  2013-08-12 18:40:41

skrollr——兼容性超强的视差滚动js插件 零、前言 我忘了第一次见到视差滚动的页面是什么时候,但是当时的感觉我到现在都忘不了。 “原来网页还可以这么设计!” 一、skrollr介绍 skrollr是一个开源的视差滚动js插件,兼容性极强,可以兼容各种浏览器(包括IE)以及手机端(IOS/Android),基本上没有兼容不了的。 skrollr自身体积只有8k,加上兼容ie和手机端的插件也不到30k,对于一个展示用页面来说这个体积确实不大了。 ......

类别 :  JS(21)  |  浏览(4829)  |  评论(0)

JS中parseInt()、random()及Math.cell()函数的学习

piaoling  2013-01-09 10:17:18

一、parseInt()函数 表 达式:parseInt(string,radio);string为将要转换的字符串,radio为转换的基数。可选。表示要解析的数字的基数。该值介 于 2 ~ 36 之间。如果省略该参数或其值为 0,则数字将以 10 为基础来解析。如果它以 “0x” 或 “0X” 开头,将以 16 为基数。如果该参数小于 2 或者大于 36,则 parseInt() 将返回 NaN。 作用:将第一个字符串参数,转换为整数; 返回值:整数; 实例: parseInt("010",10)就是10进制的结果:10 parseInt("010",......

类别 :  JS(21)  |  浏览(4511)  |  评论(0)

jQuery idleTimer plugin

piaoling  2012-12-27 14:46:04

jQuery idleTimer plugin June 3rd, 2009 There are a few cases where you want to know if the user is idle. Namely: You want to preload more assets You want to grab their attention to pull them back You want close their banking session after 5 minutes of inactivity.(Jerk!) You want the site to sneak off the screen and see if they notice ;-) Nick Zakas wrote a script for YUI3 to handle these cases. His writeup has a great description of the architecture approach he took to the script. In my jQuery adaptation, I did a few different things: Leveraged......

类别 :  JS(21)  |  浏览(4204)  |  评论(0)

js中替换字符串

piaoling  2012-10-16 13:52:29

function formatStr(str) { str=str.replace(/\r\n/ig,"<br/>"); return str; } 要注意两点: 要使用正则表达式,不能使用 str.replace("\r\n", newString); ,这会导致只替换第一个匹配的子字符串。 母字符串中不一定 \r\n 会同时存在,也许只有 \n,没有 \r 也是可能的。 replace 方法的语法是:stringObj.replace(rgExp, replaceText) 其中stringObj是字符串(string),reExp可以是正则表达式对象(RegExp)也可以是字符串 (string),replaceText是替代查找到的字符串。。为了帮助大家更好的理解,下面举个简单例子说明一下 ......

类别 :  JS(21)  |  浏览(4569)  |  评论(0)

About ckeditor.js file size

piaoling  2011-10-13 10:42:06

About ckeditor.js file size Discuss and participate of this important initiative project.   About ckeditor.js file size by yanghuijun » Thu Apr 21, 2011 2:27 am my englisth is poor.so i hope developers can understand my words. ckeditor is a nice web text editor.but the ckeditor.js file size too big(350K).when page reference this file speed is too bad.so,Whether can streamline some file size? best regrads mr.yang china ......

类别 :  JS(21)  |  浏览(4758)  |  评论(0)

ckeditor 文档

piaoling  2011-07-29 11:52:31

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html ckeditor官网:http://ckeditor.com/ CKSource Docs - The Official Documentation Site Bring rich editor features to your products and websites, providing your users with powerful tools to make creating Web content easier than ever and accessible to anyone. CKEditor 3.x Developer's Guide CKEditor 3.x User's Guide CKEditor 3.x HOWTOs CKEditor 3.x Tutorials CKEditor 3.x Accessibility Compliance ......

类别 :  JS(21)  |  浏览(4732)  |  评论(0)

JavaScript获取事件对象

piaoling  2011-07-14 10:58:43

IE中事件对象是window的一个属性,在标准DOM中,事件对象是处理函数的一个参数。 测试1: <button id="but">按钮</button> <script type="text/javascript">     var but = document.getElementById("but");     function func(){         var e = window.event || arguments[0];         alert(e.type);     }     if(window.attachEvent)         but.attachEvent("onclick",......

类别 :  JS(21)  |  浏览(4620)  |  评论(0)

Javascript获取键盘的KeyCode

piaoling  2011-07-14 10:31:03

【转自】http://hi.baidu.com/collect_zero/blog/item/a44c2c227a3ec6a54623e8b5.html Javascript获取键盘的KeyCode 把索引值转化成该键的字母或数字值,写:          String.fromCharCode(e.which) 一个测试键盘上各键对应的ASCII代码的页面 <html> <head> <script> function show(){ alert("刚才输入键的ASCII代码是:"+event.keyCode); } </script> <body> <form > <input type=text onkeydown="show()"> </form> </body> </html> 常见值 if(event.......

类别 :  JS(21)  |  浏览(4450)  |  评论(0)

JavaScript高级培训-自定义对象

piaoling  2011-07-06 15:42:19

JavaScript高级培训-自定义对象 预览: var o = {}; // 我发现了一个东西。   o.eat = function(){return "I am eating."}  // 我发现它会吃;   o.sleep = function(){return "ZZZzzz..."}  // 我发现它会睡;   o.talk = function(){return "Hi!"} // 我发现它会说话;   o.think = function(){return "Hmmm..."} // 我发现它还会思考......

类别 :  JS(21)  |  浏览(4925)  |  评论(0)

JS的正则表达式

piaoling  2011-06-23 13:11:26

JS的正则表达式 //校验是否全由数字组成 function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return true } //校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 Java代码   function isRegisterUserName(s)   {   var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;   if (!patrn.exec(s)) return false   return true   }   //校验用户姓名:只能输入1-30个以字母开头的字串 Java代码 ......

类别 :  JS(21)  |  浏览(4671)  |  评论(0)
  • Page:1/3  21 Blogs
    <<
    >>
    20088
    周日 周一 周二 周三 周四 周五 周六

    文章分类