html代码片段:

1.<ion-tabs class="tabs-icon-top tabs-color-active-positive" >2.然后在该控制器中注入需要的服务:
$ionicGesture,$ionicTabsDelegate

3.js部分:
//手势
var element1 = angular.element(document.querySelector('#eventPlaceholder'));

//左滑动
$ionicGesture.on('dragleft',function(){
var selectedIndex1 = $ionicTabsDelegate.selectedIndex();
if(selectedIndex1 == 0){
$state.go('tab.sort');
}else if(selectedIndex1 == 1){
$state.go('tab.count');
}else if(selectedIndex1 == 2){
$state.go('tab.mine');
}else if(selectedIndex1 == 3){
$state.go('tab.mine');
}

},element1)

//右滑动
$ionicGesture.on('dragright',function(){
   var selectedIndex2 = $ionicTabsDelegate.selectedIndex();
if(selectedIndex2 == 3){
$state.go('tab.count');
}else if(selectedIndex2 == 2){
$state.go('tab.sort');
}else if(selectedIndex2 == 1){
$state.go('tab.home');
}else if(selectedIndex2 == 0){
$state.go('tab.home');
}
},element1)





相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-01-16
猜你喜欢
  • 2021-05-27
  • 2021-06-13
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案