jQuery有個很方便的function:toggle,可以讓元素做指定的切換動作,若不指定任何參數,則可以讓元素做很簡單的隱藏、顯示的切換,很是方便。If they are shown, toggle makes them hidden (using the hide method). If they are hidden, toggle makes them shown (using the show method).
但今天突然發現在針對大量元素的隱藏顯示時,這個function效能很差。
More »