首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ng-演练指令触发之前设置延迟

在ng-演练指令触发之前设置延迟
EN

Stack Overflow用户
提问于 2016-04-07 17:28:08
回答 1查看 348关注 0票数 1

我目前正在使用ng-演练指令(柱塞:http://plnkr.co/edit/kHM9zHCxAA3gPYvedmdw?p=preview)为我的应用程序创建一系列屏幕上的指令。

我想在动画自动加载之前设置一个延迟。有人知道最好的方法吗?

controller.js

代码语言:javascript
复制
$scope.showAccountsWalkthrough = true;

$scope.accountsWalkthrough = {
    steps : [
        {
            id: "new-account-button",
            text : "Some text here"
        },
        {
            id: "scan-all-button",
            text : "Some text here"
        },
        {
            id: "accounts-list",
            text : "Some text here"
        }
    ],
    currentIndex : 0
};

$scope.nextAccountsWalkthrough = function() {
    ionic.requestAnimationFrame(function() {
        if($scope.accountsWalkthrough.currentIndex < $scope.accountsWalkthrough.steps.length-1) {
            $scope.accountsWalkthrough.currentIndex++;
            $scope.showAccountsWalkthrough = true;
        }
    });

}

view.html

代码语言:javascript
复制
<walkthrough
    id="accounts_view_walkthrough"
    walkthrough-type="transparency"
    focus-element-id="{{ accountsWalkthrough.steps[accountsWalkthrough.currentIndex].id }}"
    main-caption="{{ accountsWalkthrough.steps[accountsWalkthrough.currentIndex].text }}"
    force-caption-location="BOTTOM"
    is-active="showAccountsWalkthrough"
    is-bind-click-event-to-body="true"
    on-walkthrough-hide="nextAccountsWalkthrough()"
    is-round="false">
</walkthrough>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-07 19:10:01

这解决了这个问题。

代码语言:javascript
复制
    setTimeout(function(){ 
         $scope.showAccountsWalkthrough = true;
    }, 1000);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36483247

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档