Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I need to trigger a event when a specific horizontal tab has been focused. Probably it should be done implementing a the javascript hook but I can't figure out how. The only way I found is to modify directly horizontal-tabs.js putting this code in line 133, but for sure that is really a bad solution:
if (this.item.hasClass('horizontal-tab-button-3')) //do something
Comments
Comment #1
nils.destoop CreditAttribution: nils.destoop commentedYou can do this by adding your own javascript and use http://api.jquery.com/focus/ on the fieldset that represents the tab content.
Comment #3
ropic CreditAttribution: ropic as a volunteer commentedNot working for me, i needed to overwrite the focus method and fire a custom event: