1
下面的代碼顯示鼠標懸停的div,但不會隱藏鼠標離開div。如何更正代碼?如何在ng-mouseover上顯示div並在ng-mouseleave上隱藏相同的div?
<html ng-app="">
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<center>
<br>
<p ng-model="x" ng-mouseover="x='true'" ng-mouseleave="x='false'">HOVER HERE</p>
<br>
{{x}}
<div ng-show="x" style="position: relative;top: 100px;left: 0px;width: 100px;height: 100px;background-color: grey;"></div>
</center>