這段代碼在此video Tutorial
在一個非常有用的博客jquery for designers
$('.navigation').each(function() {
var $links = $('a',this);
$links.click(function () {
var $link = $(this),
link = this;
if ($link.is('.selected')) {
return;
}
$links.removeClass('selected');
$link.addClass('selected')
});
});
$(this)
和this
有什麼區別?
請解釋簡單的編碼差異。
+1兩個代碼提示。這些很容易錯過。 – cwallenpoole 2011-06-06 16:03:47
謝謝@ T.j。 Crowder – tito11 2011-06-06 16:05:50