如果我的 div 设置为visibility:hidden
会影响onmouseenter
或onmouseout
函数的行为吗?
Yes it will. Despite that the element remains visually in the document flow by leaving a space, you can't mouse-in to it because it is not visually on the page.
Something which is hidden is absent in the page. so you can't invoke any mouse events.
Yes, although it still catches some space in the flow, you can't interact with it.
yes it will get affected. As the div is hidden, mousein, mouseout and other related events will not be triggered. Check this silly fiddle.
$("#foo").mouseout(function(){ // This will stop being triggered once its invisible
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.