English 中文(简体)
j类引发的吸烟事件
原标题:Onmouseout event in javascript trigger

看来,由于在<代码><li>上的停用活动,正在启动.球菌类的停用活动。 贾瓦特人这样做是行不通的,还是我做任何错误。 如果是这样的话,请建议,只有在离开干iv时才能找到办法,才能在干.时启动停用活动。

<div class="izberiLokacija" onmouseout="alert( asd );toggleDivZaMalaMapa(2);">
          <ul>
                    <li onmouseover="toggleDivZaMalaMapa(1);">li1</li>
                    <li onmouseover="toggleDivZaMalaMapa(1);" style="border-top: solid 2px #00699B"> li2 </li>
          </ul>
</div>
最佳回答

This is the way JavaScript works. Either put a handler on each <li> to prevent bubbling (with event.stopPropagation() or by returning false), or test whether event.target is what you want it to be in your .izberiLokacija handler. Read more on event bubbling, that should clear up the confusion.

另一种办法是将<代码>onmouseout/onmouseover改为onmouseleave<>/code>>onmouseenter。 他们几乎重复了同一事件,但后一胎并不泡沫。

主题: 如果您从<代码>alert移至console.log;此外,在网上的Java文中,很难与你合作;考虑将你的联合材料和超文本分开。

问题回答

每次你都把“hover”事件推向一个因素。 各种事件还将破坏OM的树木,并给其中的家长造成火灾,......所有途径都到 body。

请DO NOT在网上分配活动......它使硬性保持代码和消化非燃烧标记成为可能。

相反,尝试这样做(利用jQuery......,因为每个人都使用j Query,权利?)

http://jsfiddle.net/ryanwheale/fab8Z/"rel=“nofollow> http://jsfiddle.net/ryanwheale/fab8Z/





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签