Angular Material mdTabs - how to get only the effect of tabs animation not the content?

前端 未结 2 1668
耶瑟儿~
耶瑟儿~ 2021-01-19 01:00

I want to get the animation effect of when someone clicks on the tab and the border below that tab slides to right with the button having a nice ripple effect. I don\'t want

相关标签:
2条回答
  • 2021-01-19 01:14

    You can add this in styles

    [role="tabpanel"] {
        transition: none;
    }
    
    0 讨论(0)
  • 2021-01-19 01:21

    You can use the md-tabs directive without the contents:

    var app = angular.module('app', ['ngMaterial']);
    app.controller('myController', function($scope) {
      $scope.selectedIndex = 0;
    });
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-animate.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-aria.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/0.10.0/angular-material.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/0.10.0/angular-material.min.css">
    
    <md-content ng-app="app" ng-controller="myController">
      <md-tabs md-dynamic-height md-border-bottom md-selected="selectedIndex">
        <md-tab label="one"></md-tab>
        <md-tab label="two"></md-tab>
        <md-tab label="three"></md-tab>
      </md-tabs>
      <div layout layout-align="center center">{{ selectedIndex }}</div>
    </md-content>

    0 讨论(0)
提交回复
热议问题