在一个div显示的悬停事件中,另一个div以及另一个div应该仍然显示在其悬停上

时间:2017-08-04 10:26:24

标签: html css angular

我想让我的另一个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;
&#13;
&#13;

链接到plunker

1 个答案:

答案 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>
相关问题