我目前正在使用ng-演练指令(柱塞:http://plnkr.co/edit/kHM9zHCxAA3gPYvedmdw?p=preview)为我的应用程序创建一系列屏幕上的指令。
我想在动画自动加载之前设置一个延迟。有人知道最好的方法吗?

controller.js
$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
<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>发布于 2016-04-07 19:10:01
这解决了这个问题。
setTimeout(function(){
$scope.showAccountsWalkthrough = true;
}, 1000);https://stackoverflow.com/questions/36483247
复制相似问题