如何把兩個function寫到外面?
如何把兩個function寫到外面?也就是先寫兩個函數,即handlerIn(eventObject):當鼠標指針進入元素時觸發執行的事件函數和handlerOut(eventObject):當鼠標指針離開元素時觸發執行的事件函數,然后再用hover調用即$(selector).hover(handlerIn, handlerOut),如果想寫成這個樣子該怎么做?
如何把兩個function寫到外面?也就是先寫兩個函數,即handlerIn(eventObject):當鼠標指針進入元素時觸發執行的事件函數和handlerOut(eventObject):當鼠標指針離開元素時觸發執行的事件函數,然后再用hover調用即$(selector).hover(handlerIn, handlerOut),如果想寫成這個樣子該怎么做?
2019-11-06
舉報
2019-11-30
function handerIn(){
}
function handlerOut(){
}
$(selector).hover(handlerIn, handlerOut)