今日学习笔记
白天在jquery fundamental看了一天的jquery,发现英文确实比翻译的文章质量要好的多,就拿我看《javascript权威指南》的感受来说,中文翻译中很多错别字而且还有不少句子语句不通,很多简单的概念讲的很绕,难以理解,但英文的资料则会给人简明扼要、浅显易懂之感。现在w3s也只看英文的了,打算逐渐培养阅读英文文献的习惯。另外就是打算调整学习的方式:先把w3s的css官方文档再看一遍,现在看的感觉和以前完全不一样了,然后开始阅读他人的博客,比如张鑫旭学长的,并在codepen.io做demo。开始做点项目,比如wordpress主题和dedecms的主题。下面记录下今天一天看到的学习到的几个知识点,都是些很基础的东西。
1.In the case of the
|| operator, the value returned is the first value that proves the statement truthy, or the last value. In the case of the && operator, the value returned is the first value that proves the statement falsy, or the last value.
2.When setting the style for several link states, there are some order rules:
- a:hover MUST come after a:link and a:visited
- a:active MUST come after a:hover
.not() is not the opposite of .is(). The .is() method returns a boolean, while the .not()method returns a new jQuery object.
4.If you need to set multiple properties at once, you can pass an object to the .css() method rather than a property name and a value. Note that you will need to quote any property names that include a hyphen.
5.Event delegation has two main benefits. First, it allows us to bind fewer event handlers than we'd have to bind if we were listening to clicks on individual elements, which can be a big performance gain. Second, it allows us to bind to parent elements — such as an unordered list — and know that our event handlers will fire as expected even if the contents of that parent element change.
6.Namespace:When would you want to use namespaces? Consider a situation where you bind some events, and then want to unbind some of the handlers.

浙公网安备 33010602011771号