.toggleClass( function(index, class, switch) [, switch ] )如何解釋?
.toggleClass( function(index, class, switch) [, switch ] );這句話怎么解釋?課程說的太繞了,理解不了,有人能用通俗易懂的話解釋一下嗎?謝謝了?
.toggleClass( function(index, class, switch) [, switch ] );這句話怎么解釋?課程說的太繞了,理解不了,有人能用通俗易懂的話解釋一下嗎?謝謝了?
2019-10-24
舉報
2019-10-29
.toggleClass( [switch ] ):一個用來判斷樣式類添加還是移除的 布爾值
?function(index, class, switch) :判斷集合中的index元素樣式類添加還是移除
.toggleClass( function(index, class, switch) [, switch ] ):function(index, class, switch) [, switch ] 為兩個參數:接收元素的索引位置和元素舊的樣式類作為參數。大概就是兩個元素的樣式類加在一起作為一個整體判斷是否添加樣式還是移除。
自己的理解,不對請指正