如何在示例中添加previous/next
按钮/选项/链接,以便在使用angularjs或javascript或jquery根据给定内容的第三个选项卡中的要求单击这些选项后,可以向前和向后移动步骤。我制造了小提琴
您是否正在寻找这样的行为:
http://jsfiddle.net/6qm7jeo3/5/
我添加了prev
和next
功能。请看看。
angular.module('TabsApp', [])
.controller('TabsCtrl', ['$scope', '$location', function($scope, $location) {
$scope.tabs = [{
title: 'One',
url: 'one.tpl.html'
}, {
title: 'Two',
url: 'two.tpl.html'
}, {
title: 'Three',
url: 'three.tpl.html'
}];
$scope.currentTab = 'one.tpl.html';
$scope.onClickTab = function(tab) {
$scope.currentTab = tab.url;
}
$scope.isActiveTab = function(tabUrl) {
return tabUrl == $scope.currentTab;
}
$scope.tab3 = 0;
$scope.next = function() {
$scope.tab3 = $scope.tab3 + 1;
}
$scope.prev = function() {
$scope.tab3 = $scope.tab3 - 1;
}
}]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句