How do I set different images for the selected active tab. I set all the tabs like this.
channel_tab.addTab("t1", "<img src='images/tab_image.png'>", "90px");
I want to tell the script to have a different image if the tab is active. If I were to change the label in the onSelect event. This would leave all the other tabs selected. I want the script to put all the tabs in normal mode except the active one.
You may try to change a tab label using setLabel method. Try to put tag with item label in the second parameter. Something like so:
tabbar.setLabel(id,"<img … > text",width);
Using onSelect event you may handle selected tab:
var labels = {“id1”:“Tab 1”, “id2”: “Tab 2”,…,“idN”:“Tab N”};
var width = {…};
var activePrefix = “…”;
var prefix = “…”;
tabbar.attachEvent(“onSelect”, function(id,prevId) {
tabbar.setLabel(id,activePrefix+labels[id],width[id])
if(prevId)
tabbar.setLabel(prevId,prefix+labels[prevId],width[prevId])
return true;
});