Loading ...
Sorry, an error occurred while loading the content.

28496Re: [ydn-javascript] Tabview - receive notification when the currently selected tab is selected again

Expand Messages
  • Matt Sweeney
    Apr 1, 2008
    • 0 Attachment
      stergios_marinopoulos wrote:
      > I would like to receive an event when the currently selected tab is
      > selected again.
      >
      Hi Stergios,

      You can listen for the "activeChange" event at the tab level. This
      always fires, currently active or not. Keep in mind that it also sets
      the active state to false, so you'll have to branch on the value if you
      are only interested in when active.

      For example:

      var onActiveChange = function(e) {
      if (e.newValue === true) {
      alert('tab "' + this.get('label') + '" activated');
      }
      };

      var tabview = new YAHOO.widget.TabView('demo');
      YAHOO.util.Dom.batch(tabview.get('tabs'), function(tab) {
      tab.on('activeChange', onActiveChange);
      });

      Matt
    • Show all 3 messages in this topic