菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app=""> <div ng-mouseover="count = count + 1" ng-init="count=0">鼠标移动到我这!</div> <h1>{{count}}</h1> <p>该实例在鼠标移动到 DIV 元素时,计算变量 "count" 会自动加 1。</p> </body> </html>
运行结果