没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
2页
俗话说的好:好记性不如一个烂笔头,本文对angularjs模块学习笔记,首先我们从anchor scroll开始学习,具体内容请看下文: •$anchorScroll()用于跳转至定义ID; •$location对象的hash()方法会替换当前url作为hash键; •$anchorScroll()读取并跳转至ID处。 下面简单的例子,这里是输出结果: 源码 index.html–11行,标示了的跳转ID: <!DOCTYPE html> <html ng-app="app"> <head> [removed][removed] <script
资源详情
资源评论
资源推荐
AngularJS模块学习之模块学习之Anchor Scroll
俗话说的好:好记性不如一个烂笔头,本文对angularjs模块学习笔记,首先我们从anchor scroll开始学习,具体内容请看下
文:
•$anchorScroll()用于跳转至定义ID;
•$location对象的hash()方法会替换当前url作为hash键;
•$anchorScroll()读取并跳转至ID处。
下面简单的例子,这里是输出结果:
源码 index.html–11行,标示了的跳转ID:
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="angular.min.js"></script>
<script src="app.js"></script>
<meta charset="utf-">
</head>
<body ng-controller="MockController">
<button ng-repeat="(key, value) in numbers" ng-click="jumper(key)"> {{key}} </button>
<div ng-repeat="(key, value) in numbers" id="{{key}}">
<h>{{key}}</h>
<ol>
<ul ng-repeat="item in value"> {{item}} </ul>
</ol>
</div>
</body>
</html>
app.js
var demoApp = angular.module("app",[])
.controller("MockController",
function ($scope, $location, $anchorScroll) {
weixin_38621250
- 粉丝: 2
- 资源: 908
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0