01 - Learn how Script Tags and Document Ready Work
先添加 document ready function
若沒有添加 $(document).ready(function() { });, js 會在 html 渲染前就先執行,這樣會產生 bug
<script>
$(document).ready(function() { });
</script>
<!-- Only change code above this line. -->
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>
02 - Target HTML Elements with Selectors Using jQuery
$ dollar sign operator, bling
已經預載 jQuery.js, animated bounce.css
03-Target Elements by Class Using jQuery
04-Target Elements by ID Using jQuery
替 div#target3 添加 fadeout 特效
05-Delete your jQuery Functions
教學說 jQurey 的特效會讓人分心,要我先把三個語句都刪掉 XD
06-Target the same element with multiple jQuery Selectors
從前面知道了 type: $("button"), class:$(".btn"), id:$("target3") 三種選擇方式
讓一個元素能被 jQuery Selectors 選擇多次
07-Remove classes from an element with jQuery
08-Change the CSS of an Element Using jQuery
有 quote,用 comma instead of colon
09-Disable an Element Using jQuery
直接用 jQuery 修改除了 css 以外的元素的屬性
10-Change Text Inside an Element Using jQuery
11-Remove an Element Using jQuery
12-Use appendTo to Move Elements with jQuery
把 div 中的某個元素,移動到另外一個 div 中
13-Clone an Element Using jQuery
function chaining,方法鏈,串起兩個方法
14-Target the Parent of an Element Using jQuery
15-Target the Children of an Element Using jQuery
16-Target a Specific Child of an Element Using jQuery
target:nth-child(n) 選擇目標元素的所有子元素
17-Target Even Numbered Elements Using jQuery
18-Use jQuery to Modify the Entire Page