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