Javascript onHover event

前端 未结 4 709
无人及你
无人及你 2020-11-29 02:49

Is there a canonical way to set up a JS onHover event with the existing onmouseover, onmouseout and some kind of timers? Or just any method to fire an arbitrary function if

4条回答
  •  有刺的猬
    2020-11-29 03:32

    I don't think you need/want the timeout.

    onhover (hover) would be defined as the time period while "over" something. IMHO

    onmouseover = start...
    
    onmouseout = ...end
    

    For the record I've done some stuff with this to "fake" the hover event in IE6. It was rather expensive and in the end I ditched it in favor of performance.

提交回复
热议问题