0
在我的网页,我的AngularJS鼠标离开触发错过
<div ng-repeat='img in imgList'>
<div class='img_container' ng-mouseover="show(img)" ng-mouseleave="hide(img)">
<div>one thumbnail</div>
<div class='overlay_edit' ng-show='img.isShowEdit'></div>
</div>
</div>
// from controller
$scope.hide = function hide(img){
img.isShowEdit = false;
}
$scope.show = function show(img){
if(img.metas != undefined && img.metas.length > 0){
// a few lines of codes to use img.metas to
// format the edit div block, omitted for simplicity
// but it does involve calling a REST service call
// to retrieve all meta properties.
img.isShowEdit = true;
}
}
数组时,鼠标进入div容器,当鼠标离开div容器隐藏叠加编辑DIV显示。
我遇到的问题是,当鼠标在很多容器中移动得太快时,我会看到很多鬼影叠加层。
解决此问题的最佳方法是什么?
编辑添加其他信息和更正错误。
你可以显示show()函数吗? – 2014-09-13 18:19:43
添加了show()并纠正了错误。谢谢。 – 2014-09-13 18:42:23