Arcen
March 9, 2014, 7:31pm
1
Hello,
I’m new to the ionic framework and angular. I was wondering if there was a way I can have tabs on top of a “content” area that has “slidebox” nested within so when I click on tab it will show a specific slidebox.
Here an example:
<tabs>
<tab>Toys</tab>
<tab>Price</tab>
</tabs>
<ion-slide-box show-pager="false">
<ion-slide>
<div class="box blue">
<h1>Toys Content</h1>
</div>
</ion-slide>
<ion-slide>
<div class="box yellow">
<h1>Price Content</h1>
</div>
</ion-slide>
</ion-slide-box>
So basically I want to click on the “Price” tab and it will show the price slide and the same goes for the other tab.
Any suggestions?
I did something similar, but using a button group to select my desired slide index.
If you are building your app in Angular, use this code:
var gotoSlide = function(index) {
$scope.$broadcast('slideBox.setSlide', index);
}
Call the gotoSlide
function, with your desired slide number (index)
inside of your tab, and it should work.
Note : the slide index numbers start from 0, 1, 2 … n.
Refer to this for more help:
Before moving my angular app to ionic, I had hand-hacked up a navigation somewhat like the ionic slideBox. I was displaying a series of cruise ship deck images, and the routing was such that /decks/2 would take you to deck 2, /decks/3 to 3.
I’ve switched it to using slideBox and it works very smoothly (unlike my version :P) but I have 2 things I can’t seem to make work.
I’d love to update the history so that when a slide changes, the route updates like the old code.
I want to be able to star…
1 Like
Arcen
March 9, 2014, 9:05pm
3
I appreciate the response. I will work on it tonight and come back if needed.
Thanks!