01 2015 档案
js--使用构造器函数来新建对象及操作
摘要:通过new操作符来调用函数,来达到访问对象this值得目的,构造器将其创建的对象返回给我们。直接上代码//创建构造器函数function Gadget(name, color){ this.name = name ;//添加属性 this.color = color ; this.whatAr... 阅读全文
posted @ 2015-01-12 21:39 风霄圣兮 阅读(217) 评论(0) 推荐(0)
css中table样式
摘要:border-spacing:设置相邻单元格的边框间的距离;border-collapse:设置表格的边框是否被合并为一个单一的边框;{separate/collapse/inherit(IE不支持该属性)}text-align:水平对齐方式{left/center/right}vertical-a... 阅读全文
posted @ 2015-01-06 13:59 风霄圣兮 阅读(549) 评论(0) 推荐(0)
js 字符串截取
摘要:substr方法:text.substr(start[,length]);text:要提取子字符串的字符串或String对象。必选start:子字符串的起始位置。以0开始索引。必选length:返回字符串的个数。可选如length为0或负数,将返回空字符串。如没指定,则返回以start开始到结尾的子... 阅读全文
posted @ 2015-01-05 18:15 风霄圣兮 阅读(323) 评论(0) 推荐(0)
JavaScript中Math--random()/floor()/round()/ceil()
摘要:Math.random():返回0-1之间的任意数,不包括0和1;Math.floor(num):返回小于等于num的整数,相当于四舍五入的四舍,不五入;例子:Math.floor(1.0);Math.floor(1.5);Math.floor(1.9);都返回1;Math.round(num):n... 阅读全文
posted @ 2015-01-03 12:05 风霄圣兮 阅读(241) 评论(0) 推荐(0)