?
This document uses PHP Chinese website manual Release
檢查當(dāng)前的元素是否含有某個(gè)特定的類,如果有,則返回true。
這其實(shí)就是 is("." + class)。
用于匹配的類名
給包含有某個(gè)類的元素進(jìn)行一個(gè)動(dòng)畫。
<div class="protected"></div><div></div>
$("div").click(function(){ if ( $(this).hasClass("protected") ) $(this) .animate({ left: -10 }) .animate({ left: 10 }) .animate({ left: -10 }) .animate({ left: 10 }) .animate({ left: 0 }); });