Skip to content

Instantly share code, notes, and snippets.

@justinpeterman
Created November 1, 2011 07:30
Show Gist options
  • Save justinpeterman/1330097 to your computer and use it in GitHub Desktop.
Save justinpeterman/1330097 to your computer and use it in GitHub Desktop.
tabs
new joContainer([
tabContent = new joContainer([
new joTitle("Hello from tab1").setStyle({
display: 'none'
}), new joTitle("Hello from tab2").setStyle({
display: 'none'
})]),
new joFlexrow(
new joOption(["Video Info", "Related Videos", ]).selectEvent.subscribe(function (value) {
for (i in tabContent.data) {
tabContent.data[i].setStyle({
display: 'none'
});
}
tabContent.data[value].setStyle({
display: 'block'
});
}))
]),
@davebalmer
Copy link

This is a fine approach, though you might want to use joStack to push/pop views in which correspond to each "tab".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment