How does the jQuery extension for on show work?

Bronze Contributor
Bronze Contributor
I am looking to use the jQuery extension for trigger on show. i am trying to test in the console before adding into the interface using the following code which I got from the Tealium code that loaded jQuery('#selectid').on('afterShow', function (e) { if (jQuery('#selectid').is(':visible')) { utag.link({ EventCategory: 'test', EventAction: 'test', EventLabel: 'test', EventValue: 'test' }) } }) However this does not work in the console. I cannot see afterShow anywhere on the official jQuery site.
3 REPLIES 3

How does the jQuery extension for on show work?

Tealium Employee
Hi Tahir, For the "show" (and "hide") trigger, we are doing a bit of custom logic to support it. It can support multiple matches to the selector, though the content must be hidden on page load for this to work. We are polling every 250ms to see if the content is there and once it is there the utag.link will fire. This was written over a year ago and jQuery may have a better way to handle this by now. I would suggest contacting your Account Manager to put you in contact with a solutions team member who is able to work with you to determine your exact needs and whether or not our solution will handle this or if you need some customer JS/jQuery code. Cheers, -Dan

How does the jQuery extension for on show work?

Tealium Employee
You can read more about custom jQuery events here: http://learn.jquery.com/events/introduction-to-custom-events/

How does the jQuery extension for on show work?

Bronze Contributor
Bronze Contributor
Hi George, Thank you for the quick response. I thought that may have been a custom event. I will continue to test directly from the interface and if there are any issues I will contact the account manager to see if there are alternative solutions. Thanks Tahir
Public