KenSmith
Active member
In an addon I am developing, I'm using the XenForo.Tabs feature in one of my templates.
One of the tabs includes a Google map, and I want to create the map only if the user clicks on that particular tab.
I can't figure out how to fire my custom Javascript when the visitor clicks on the Map tab.
It seems like I should be able to use the tabsactivate event documented in Jquery UI here:
http://api.jqueryui.com/tabs/#event-activate
As a way to illustrate my issue, if I wanted to do something similar on the member view page of a stock install of XenForo:
If I edit the 'member_view' template and add this to the top:
Why don't I get an alert on a page like
http://mysite.com/members/1/
when I click another tab like 'Recent Activity'?
One of the tabs includes a Google map, and I want to create the map only if the user clicks on that particular tab.
I can't figure out how to fire my custom Javascript when the visitor clicks on the Map tab.
It seems like I should be able to use the tabsactivate event documented in Jquery UI here:
http://api.jqueryui.com/tabs/#event-activate
As a way to illustrate my issue, if I wanted to do something similar on the member view page of a stock install of XenForo:
If I edit the 'member_view' template and add this to the top:
Code:
<script type="text/javascript">
$(function() {
$('.Tabs').on('tabsactivate', function() { alert('User clicked a tab'); });
});
</script>
Why don't I get an alert on a page like
http://mysite.com/members/1/
when I click another tab like 'Recent Activity'?