jQuery学习笔记1
jQuery学习笔记1 开始之前:http://docs.jquery.com/ 是jQuery文档的网站, https://jsfiddle.net/是js的在线验证工具。 1.首先复习一下html, css, js三个文件的协同作用 html负责内容elements和骨架tags,div css负责格式样式大小、颜色等 js负责动作效果,操作html JQuery是一个面向javascript的工具库,基于DOM-Document Object Model文档对象模型,通过使用jQuery可以方便实现效果。 1.1-html包含css与JavaScript的基本骨架代码 1. <!DOCTYPE html> 2. <html> 3. <head> 4. <title></title> 5. <link rel="stylesheet" type="text/css" href="stylesheet.css"/> 6. <script type="text/javascript" src="script.js"></script> 7. </head> 8. <body> 9. <div id="red" ></div> 10. </body> 11. </html> 2.好,让我们开始接触jQuery Getting Started Next, we’ll need to start up our jQuery magic using the $(document).ready(); syntax you’ve seen. It works like this: 1. $() says, "hey, jQuery things are about to happen!"是把()内的东东转化成jQuery的object,从而有后面的.ready这个method 2. Putting document between the parentheses tells us that we're about to work our magic on the HTML document itself.
…