angular-tour 用户新手引导
- 下载安装
bower install angular-tour
建立依赖,引入文件
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-tour/dist/angular-tour-tpls.min.js"></script>- 使用 首先建立<tour>元素进行包裹
// step 关联$scope.currentStep,默认为-1,为0时自动执行;
// post-tour 执行完成时执行
// post-step 最后一步时被调用
// tour-complete 每次步数改变时执行
<tour step="currentStep" post-tour="postTourCallback()" post-step="postStepCallback()" tour-complete="tourCompleteCallback()">
<virtual-step
// 标题
tourtip="Angular Tour allows you to give an interactive tour to showcase the features of your website."
// 下一步按钮内容
tourtip-next-label="Learn more"
// 出现位置
tourtip-placement="right"
// 步数
tourtip-step="0"
// 调转目标 id为e0的元素
tourtip-element="#e0"></virtual-step>
<virtual-step
tourtip="Angular tour has some cool features."
tourtip-placement="right"
tourtip-step="1"
tourtip-element="#e1"></virtual-step>
<virtual-step
tourtip="And is tested in all major browsers."
tourtip-next-label="Continue"
tourtip-placement="bottom"
tourtip-step="2"
tourtip-element="#e2"></virtual-step>
<virtual-step
tourtip="Thanks for reading. Head over to the github page for more info."
tourtip-next-label="Finish"
tourtip-placement="left"
tourtip-step="3"
tourtip-element="#e3"></virtual-step>
</tour> - angularjs内容启动
angular.module('demoApp', ['angular-tour', 'ngCookies'])
.controller('DemoCtrl', function($scope, $cookies) {
// $scope.currentStep 从cookie中获取 var curStep = $cookies.get('myTour');
if(typeof curStep === 'string')
curStep = parseInt(curStep); $scope.currentStep = curStep || 0; $scope.postTourCallback = function() {
console.log('tour closes');
}; $scope.tourCompleteCallback = function() {
console.log('tour completed');
} $scope.postStepCallback = function() {
console.log('Tour - Update Step', $scope.currentStep);
$cookies.put('myTour', $scope.currentStep);
};
});
angular-tour 用户新手引导的更多相关文章
- ANGULAR 开发用户选择器指令
在开发表单时,我们需要使用经常需要使用到用户选择器,用户的数据一般使用如下方式存储: 用户1,用户2,用户3 我们可以使用angular指令实现选择器. <!DOCTYPE html> ...
- angular源码分析:angular中各种常用函数,比较省代码的各种小技巧
angular的工具函数 在angular的API文档中,在最前面就是讲的就是angular的工具函数,下面列出来 angular.bind //用户将函数和对象绑定在一起,返回一个新的函数 angu ...
- Angular CLI behind the scenes, part one
原文:https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art074 --------------------------- ...
- Angular 1 深度解析:脏数据检查与 angular 性能优化
TL;DR 脏检查是一种模型到视图的数据映射机制,由 $apply 或 $digest 触发. 脏检查的范围是整个页面,不受区域或组件划分影响 使用尽量简单的绑定表达式提升脏检查执行速度 尽量减少页面 ...
- JavaScript富应用MVC MVVM框架
对框架的挑选 Ember.js.Backbone.js.Knockout.js.Spine.js.Batman.js , Angular.js 1. 轻量级的应用选择哪一个会比较好?2. 那一个比较简 ...
- 使用Angularjs和Vue.js对比
使用Angularjs和Vue.js对比 之前项目都是使用Angularjs,(注明此处主要讲Angularjs 1)在初步使用Vue.js后做一个简答的对比笔记. 首先从理论上简单说一下各自的特点, ...
- [译]为什么Vue不支持templateURL
原文链接 Vue的新用户最常问的一个问题,特别是以前使用Angular的用户,是"我可以使用" templateURL吗?这个问题我回答过很多次,现在写一个统一回复. 在Angul ...
- vuejs angularjs 框架的一些比较(vue项目重构四)
使用Angularjs和Vue.js对比 首先需要说明的是:现在默认angularjs指angular1.0+版本,angular默认指2.0以上版本.本文的名词也默认指定angular的1.0+版本 ...
- angular7新特性
Angular 是最流行的 Web 应用程序开发框架之一.随着 Angular 7 的发布,它为 Web 开发人员带来了更多功能,包括核心框架.Angular Material.与主要版本保持同步的 ...
随机推荐
- 使用typeid(变量或类型).name()来获取常量或变量的类型---gyy整理
使用typeid(变量或类型).name()来获取常量或变量的类型 <typeinfo> 该头文件包含运行时类型识别(在执行时确定数据类型)的类 typeid的使用 typeid操作 ...
- Linux下的动态连接库及其实现机制
Linux与Windows的动态连接库概念相似,但是实现机制不同.它引入了GOT表和PLT表的概念,综合使用了多种重定位项,实现了"浮动代码",达到了更好的共享性能.本文对这些技术 ...
- !! Scrum之 流程和术语
!!Scrum之 流程和术语 http://www.cnblogs.com/zhoujg/archive/2009/07/15/1523680.html 以下将对一些术语进行简单介绍,以便大家现在开始 ...
- 【POJ】2104 K-th Number
区间第K大数.主席树可解. /* 2104 */ #include <iostream> #include <sstream> #include <string> ...
- Android开发之技术文章索引
Activity: 1.PreferenceActivity Fragment: 1.fragment中套用PagerSlidingTabStrip,切换底部时viewpager消失的解决 Widge ...
- Managed C++中使用Nullable<T>
非null值表示和C#的用法一样. Nullable<int> a = 1; null值的表示: Nullable<int> a = Nullable<int>() ...
- poj 2635 The Embarrassed Cryptographer(数论)
题目:http://poj.org/problem?id=2635 高精度求模 同余模定理. 题意: 给定一个大数K,K是两个大素数的乘积的值.再给定一个int内的数L 问这两个大素数中最小的一个是 ...
- poj 1836 Alignment(dp)
题目:http://poj.org/problem?id=1836 题意:最长上升子序列问题, 站队,求踢出最少的人数后,使得队列里的人都能看到 左边的无穷远处 或者 右边的无穷远处. 代码O(n^2 ...
- jquery UI Draggable和Droppable 案例
<html> <head><title>draggable</title> <script type="text/javascript& ...
- 异常处理 Exception
一.异常类 1.在C#中所有的异常都是使用一个异常类型的示例对象表示的,这些异常类型都是继承自System.Exception类型,或者直接使用System.Exception类型的实例对象: 2.在 ...