NG-鼠标悬停和NG-鼠标离开事件不工作的铬 [英] ng-mouseover and ng-mouseleave events not working on chrome

查看:931
本文介绍了NG-鼠标悬停和NG-鼠标离开事件不工作的铬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了我的角应用以下

I have set up the following in my angular app

我有以下NG-鼠标悬停和NG-鼠标离开的事件联系在一起的图像标记的图像

I have an image with the following ng-mouseover and ng-mouseleave events tied to the image tag

<img ng-mouseover="infoIconStyle={'height':'50px','padding':'10px'}"  ng-mouseleave="infoIconStyle={'height':'0','padding':'0'}" src="images/info-icon.svg" />

这些鼠标事件被发送到下面的div

These mouse over events are then sent to the following div

<div class="dataBoxInfoContent" ng-style="infoIconStyle">{{description}}</div>

因此​​,当NG-鼠标悬停触发dataBoxInfoContent格打开,由于高度从0到50像素,当NG-鼠标离开触发格再次关闭。

Therefore when ng-mouseover is triggered the dataBoxInfoContent div opens due to the height going from 0 to 50px and when ng-mouseleave is triggered the div closes again.

但由于某种原因,NG-MouseLeave在鼠标离开的形象,这是只有在谷歌浏览器不会触发时。所有工作在Internet Explorer和Mozilla Firefox的罚款。

However for some reason ng-mouseleave is not trigged when the mouse leaves the image and this is only in Google Chrome. All works fine in internet explorer and mozilla firefox.

任何人都知道这是为什么这样?

Anyone know why this is the case?

推荐答案

我曾与Chrome浏览器类似的问题,并最终跟踪这个问题到一个特定的Chrome扩展(对我来说,这是<一个href=\"https://chrome.google.com/webstore/detail/angularjs-batarang/ighdmehidhipcmcojjgiloacoafjmpfk\">AngularJS Batarang 扩展名)。

I had a similar problem with Chrome and eventually tracked the issue down to a specific Chrome Extension (for me, it was the AngularJS Batarang extension).

如果您有任何JavaScript的分析扩展缓慢,那些添加到您的网页有时会导致事件异常行为(尤其是鼠标移动事件)。

If you have any javascript-profiling extensions, the slowness that those add to your page can sometimes cause unusual behavior in events (in particular, the mouse-movement events).

在Chrome的调试器的配置文件选项卡中,使用收集的JavaScript CPU的个人资料,找出哪些脚本,如果有的话,是猪,然后,如果你将鼠标悬停在右侧的脚本,它会告诉你其中Chrome扩展生猪的一部分。

In the "Profiles" tab of the Chrome debugger, use the "Collect JavaScript CPU Profile" to find out which scripts, if any, are hogs, and then if you hover over the script on the right, it will tell you which chrome extension the hog is a part of.

这篇关于NG-鼠标悬停和NG-鼠标离开事件不工作的铬的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆