我想让我的另一个div继续显示 - 在这个文章"你好"关于它的悬停事件。我的另一个div不是我主要div的子元素,我称之为悬停事件。
document.write("<base href=\"" + document.location + "\" />");
&#13;
<!doctype html>
<html ng-app="plunker">
<head>
<meta charset="utf-8">
<title>AngularJS Plunker</title>
<link rel="stylesheet" href="style.css">
<script src="http://code.angularjs.org/1.1.0/angular.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<span ng-mouseenter="show = true" ng-mouseleave="show = false">
Mouse over me.
</span>
<br /><br />
<div ng-show="show">Hello!</div>
</body>
</html>
&#13;
链接到plunker。
答案 0 :(得分:0)
试试这个:
<span ng-mouseenter="show = true" ng-mouseleave="show = false">
Mouse over me.
</span>
<div ng-show="show" ng-mouseenter="show = true" ng-mouseleave="show = false">Hello!</div>