views:

81

answers:

1

Hi all, I am using zapatec tabs on my website. There are some javascript function which I want triggered when tab is loading. How do I go about it since the window.onload is not working. There is one main page on which the tabs are added and that is why the page is already loaded by the time the tabs are being loaded. Thanks in advance, Regards Richard.

A: 

According to the Zapatec documentation I was able to find, there are two events available to you, depending on when exactly you want to execute your functions:

onBeforeTabChange:

The onBeforeTabChange option allows you to set a callback that is called when the user has indicated to leave a tab. Return false in the callback to prevent tab change, return true to allow it.

A common use of onBeforeTabChange is to validate the contents of a tab, and return false if the user needs to fix some errors before moving on to another tab.

onTabChange

The onTabChange option allows you to set a callback that is called after the focus has left the old tab and is on the new one. The respective tab IDs are passed in one argument called objArgs.

Welbog