Ychow Xiao

Results 20 issues of Ychow Xiao

currentColor 表示“当前的标签所继承的文字颜色”。如果你不懂,让我们用通用语言--代码,来为大家解释。 ``` javascript CSS3----currentColor a{ display:inline-block; padding:10px; text-align:center; color:#fc6; border:2px solid currentColor; } a:hover{ color:#ccc; } 呵呵 ``` 运行上面这段代码,你就会发现,当鼠标移到a标签上,它的border颜色也跟着变化,是和当前标签文字颜色一致。 除了border,还有boxShadow、gradient、box-shadow、SVG的填充色 – fill等等。 > Tips 其实对于border、boxShadow想要实现这种效果,有一个非常简便的方法,并且还支持ie6(boxShadow除外,你懂得)。 那就是在写border、boxShadow的颜色值时,我们不写它。 ``` javascript CSS3----currentColor...

Css3

## 基本类型 #### 布尔值 ``` javascript var isDone: boolean = false; ``` #### 数字类型 > 和JavaScript一样,TypeScript中的numbers都是浮点类型的。 ``` javascript var height: number = 6; ``` #### 字符串 > 在 TypeScript中,也使用双引号或者单引号来包着字符串。 ```...

TypeScript

- aqua-theme https://github.com/appleton/aqua-theme ![aqua-theme](https://raw.githubusercontent.com/cafarm/aqua-theme/master/ProKit/ProKit.png) ![aqua-theme](https://github.com/cafarm/aqua-theme/raw/master/AppKit/AppKit.png) - Soda Theme https://github.com/buymeasoda/soda-theme ![Soda Theme](https://camo.githubusercontent.com/092b029ad05a780ed38533c48e473e903ea7ce65/687474703a2f2f6275796d6561736f64612e6769746875622e636f6d2f736f64612d7468656d652f696d616765732f73637265656e73686f74732f736f64612d322d6c696768742d7468656d652e706e673f763d34) ![Soda Theme](https://camo.githubusercontent.com/39feeec102d65ccd7a5b7d10bcf3acc674c8705b/687474703a2f2f6275796d6561736f64612e6769746875622e636f6d2f736f64612d7468656d652f696d616765732f73637265656e73686f74732f736f64612d322d6461726b2d7468656d652e706e673f763d32) - Dracula Theme https://github.com/zenorocha/dracula-theme ![Dracula Theme](https://camo.githubusercontent.com/aea89452971cfb8ae291073fae2e06ad45bd2843/687474703a2f2f7a656e6f726f6368612e6769746875622e696f2f64726163756c612d7468656d652f6173736574732f696d672f73637265656e73686f742d61746f6d2e706e67) ![Dracula Theme](https://camo.githubusercontent.com/29048e9bd5d2d04379c796e7c5ab2ec3aad62b36/687474703a2f2f7a656e6f726f6368612e6769746875622e696f2f64726163756c612d7468656d652f6173736574732f696d672f73637265656e73686f742d7375626c696d652e706e67) - Theme - itg.flat https://github.com/itsthatguy/theme-itg-flat ![Theme - itg.flat](https://camo.githubusercontent.com/4fe8be4610f3bd3dd77dd38a22e742b595804e93/68747470733a2f2f7777772e657665726e6f74652e636f6d2f73686172642f733131372f73682f65366535353337322d653466332d343663372d623464342d3338353464646238376362322f39323032383964346365643130343938666561396464653635316339616263392f646565702f302f5061737465642d496d6167652d31322d31352d31332c2d31322d35312d414d2e6a7067) ![Theme...

tools

ECMAScript 5新增了两个数组的归并方法:reduce() 和 reduceRight() 。 这两个方法都会迭代数组的所有项,然后构建最终的一个返回值。reduce() 方法从数组的第一项开始,逐个遍历到最后;reduceRight() 方法则从最后一项开始,向前遍历到第一项。 ``` ruby var numbers=[1,2,3,5,6,7,8]; var reduceTotal=numbers.reduce(function(prev,cur,index,array){ return prev+cur; }); console.log(reduceTotal); //32 var reduceRightTotal=numbers.reduceRight(function(prev,cur,index,array){ return prev+cur; }); console.log(reduceRightTotal); //32 ``` > 浏览器支持:IE9+

Javascript

ECMAScript5 为数组提供了5个迭代方法 : - every() :对数组中的每一项运行给定函数,如果该函数对每一项都返回true,则返回true。 - some() :对数组中的每一项运行给定函数,如果该函数对任一项返回true,则返回true。 - forEach() :对数组中的每一项运行给定函数,没有返回值。 - filter():对数组中的每一项运行给定函数,返回该函数会返回true的项组成的数组。 - map() : 对数组中的每一项运行给定函数,返回每次函数调用的结果组成的数组。 ``` ruby var numbers=[1,2,3,5,6,7,8]; var everyResult=numbers.every(function(item,index,array){ return item>2 }); console.log(everyResult); //false var...

Javascript

对象也可以被强制转换为原始值。最常见的用法就是转换为字符串: ``` ruby alert("Math 对象:"+Math) ; // "Math 对象: [object Math]" alert("JSON 对象:"+JSON) ; // "JSON对象: [object JSON]" ``` 对象通过隐式的调用toString方法转换为字符串。你也可以通过调用对象的toString方法进行验证: ``` ruby alert(Math.toString()) ; // " [object Math]" alert(JSON.toString()) ;...

Javascript

由于NaN不等于其自身,所以我们可以根据它的这一特性来判定一个值是否是NaN。 ``` ruby function isNaN(x){ return x !== x } ```

Javascript

其实闭包真没有什么好可怕的。学会它,你只需要理解3个事实。 - Javascript允许你引用在当前函数以外定义的变量。 ``` javascript function test(){ var sometext="Hello"; function make(name){ return sometext+","+name; }; return make("ychow"); }; test(); //"Hello,ychow" ``` - 即使外部函数已经返回,当前函数仍然可以引用在外部函数所定义的变量。 ``` javascript function test(){ var test="helo"; function make(name){...

Javascript

Ionic终于结束了测试版的开发!Ionic 1.0 正式版(Ionic 1.0 RC )终于来了! 在新版本中,有提升,也有新的一些特性。 ## 新特性 #### Ios Swipe Back 用 Ionic 来实现这个效果,我已经等了非常久了。而且每当人们争论 Native 和 Hybrid 时,讨论最多的一个特性就是它。当你使用 ios 设备时,两个页面间如果进行导航操作,你可以很轻松的往左滑,来返回到前一页。 这是一个非常酷的效果,而且我非常期待它出现在我的 Ionic App 中。而且我觉得要实现它,其实是非常困难的。以至于 Ionic 团队花费了整个假期来实现它。有了这个效果,你就可以让你的 Ionic App...

ionic

[![](https://d262ilb51hltx0.cloudfront.net/max/800/1*0S6ISYXf1GCQyili85sajA.png)](http://www.ng-conf.org/) ### Keynotes #### [Day1 Welcome](http://schedule.ng-conf.org/#details/keynote-day-1) [mp4](https://www.youtube.com/watch?v=QHulaj5ZxbI&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&t=11) [slides](http://bit.ly/day-1-keynote-slides) **Brad Green** [@bradlygree](https://twitter.com/bradlygreen)n, [github](https://github.com/bradlygreen) **Igor Minar** [@IgorMinar](http://twitter.com/IgorMinar), [github](https://github.com/IgorMinar), [blog](http://blog.igorminar.com/) #### [Day2 Keynote](http://schedule.ng-conf.org/#details/keynote-day-2) [mp4](https://www.youtube.com/watch?v=-dMBcqwvYA0&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&index=21) [slides](https://docs.google.com/presentation/d/1XoizA8Dm_S3SU1jYPERmgWVIbqjGOXolpF3Jm2b8xKA/edit) [demo code](https://github.com/rkirov/youtube-app) **Miško Hevery** [@mhevery](http://twitter.com/mhevery), [github](https://github.com/mhevery), [website](http://misko.hevery.com/) *_Rado...

Angular