Angularjs - Horizontal scroll upon button click

2.1k Views Asked by At

How to do horizontal scroll on click with right and left arrow.

<div ng-controller="TabsDemoCtrl">
<button class="btn-sm btn-default glyphicon glyphicon-chevron-left" style="float: left; margin-top: 22px" ng-click="horizontalScroll()"></button>
  <uib-tabset active="active">
    <uib-tab index="0" heading="Static title">Static content</uib-tab>
    <uib-tab index="$index + 1" ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled">
      {{tab.content}}
    </uib-tab>
  </uib-tabset>
<button class="btn-sm btn-default glyphicon glyphicon-chevron-right" style="float: right; margin-top: 22px;  right: 0px; position: absolute"  ng-click="horizontalScroll()"></button>
</div>

Here i created with tabs and buttons using sample tutorial. Attached the link

Please help me to fix this.

1

There are 1 best solutions below

0
On

use <scrollable-tabset> Its available on GitHub https://github.com/VersifitTechnologies/angular-ui-tab-scroll