1.面向對象(僞面向對象) 原型 function Animal(name,age){ this.name = name; this.age = age; }; Animal.prototype.showName = function(){ console.log(this.name); } var a = new Animal(); a.showName() 字面量方式建立 var obj = { name:'alex', age:18, fav:function(){ } }; 2.定時器 setTimeout() 一次性定時器 setInterval() 循環週期的定時器 使用定時器: 上來先清定時器 clearInterval(),再開定時器 3.BOM open(); location.href = '地址' 今日內容: 使用第一步 1.引包 <script src="jquery.js"></script> 2.使用 入口函數 $(document).ready(function(){}); $(function(){}) 三步走: 1.事件對象 $(選擇器) 返回的是jquery對象 2.js轉jquery $(js對象) jquery轉js $(選擇器)[0] 當心this 3.// jquery 鏈式編程 $(this).css({ 'backgroundColor':'green', 'width':'300px' }).attr('id','box'); 4.jquery的篩選選擇器和基本過濾器 siblings 選中兄弟元素 除了本身 使用它來作選項卡 排他思想 5.jquery的動畫 show() hide() slideDown() slideUp() fadeIn() fadeOut() animate() 自定義動畫