Mouseover triggered on absolute positioned div

守給你的承諾、 提交于 2019-12-06 12:46:43

If you change your events then the rest of what you have (appending to <body>) will work, like this:

$('._previewable').live('mousenter mouseleave',function(event) {

Unlike mouseover and mouseout, the mousenter and mouseleave events won't fire when moving to or from a child, so they'll behave like you want in this case.

For cleanliness though, I'd bind .live('mouseenter) and .live('mouseleave') separately and remove the if(), it's much easier to look and see what's going on, might be just me though :)

That looks like a whole lot of work just to avoid having the little tiny image in each cell. You're not really gaining very much by "reusing" just one instance of the element. Browsers will only have to download the image once. And from a performance point of view, fiddling with the DOM tree takes more resources than just switching the display property of a highlighted element.

Simplest approach may just be to put the <span> in every cell you ever print out, then use CSS to hide/display.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!