Swipe right to get other tab Swipe left to get previus tab


#1

Hi , I’m using the basic tabs app from the Getting started section. I found an example about my problem in swiping tabs , but the swipe right is not working ,can you help me ? Thanks .


#2

Sorry, but have you carefully check this example?

Swipe left works just fine but it’s used only on one tab, you need to add it to all of them.


#3

@Gajotres I’m sorry my mistake , the swipe right I was Talking about is not functioning. :sweat_smile:


#4

It will work if you add it like this: http://codepen.io/Gajotres/pen/qdQgWo

on-swipe-right="goTo('tabs.home')"

In this example, you can switch between tabs Home and About.

Or if you want to save history order use on-swipe-right to call

history.back()

Though I would like to advise you to move function goTo to some service or factory, no point in having multiple iterations of the same function among different views.


#5

how about if I’m in “About Tab” , How can move to “Contact Tab” by swiping left again ?


#6

Wow, I figure it out , Now I Understand ,
I put inside the ion-view the on-swipe-left="goTo(‘tabs.contact’)"
Thanks for the help @Gajotres :smile:


#7

And you only had to ask :smile:


#8

Thanks you so much :grin:


#9

How about putting some animation when I Swipe ? Just like the slidebox when I swipe the page ? Is that possible in ionic ?


#10

Something like this: http://codepen.io/Gajotres/pen/bdQZbq


#11

yes, but why, is there a black animation when I swipe it ? Can I remove that black animation when I Swipe ?


#12

You will need to google it a bit, I currently to busy to check that out.


#13

Ok , by the way thanks for the time and help :grinning:


#14

You’re welcome m8 :smile:


How to switch template as a slide?
#15

In case someone else is looking for animated tabs or swipable tabs, i just created a directive for that matter.
just give it a try, GitHub repository.