?
本文檔使用 PHP中文網(wǎng)手冊 發(fā)布
檢查當(dāng)前的元素是否含有某個特定的類,如果有,則返回true。
這其實就是 is("." + class)。
用于匹配的類名
給包含有某個類的元素進行一個動畫。
<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 }); });