- show the content of the tab, happens by default
- update a div on the page somewhere with some content related to the tab content
Quite simple.
<script type="text/javascript">
var myTabs = new YAHOO.widget.TabView('demo');
var tab0 = myTabs.getTab(0);
function handleClick(e,tab) {
${"div_to_update"}.update("I just clicked on my tab!");
}
tab0.addListener('click', handleClick,tab0);
</script>
and as you can see we use the 'update' function from the prototype library.
No comments:
Post a Comment