Documentation:UBC Content Management System/How to/How to link to a tab?

From UBC Wiki
Jump to: navigation, search

Add the following jQuery to each page that requires this function below in the 'Custom JavaScript' section, or in the site's 'Global Theme Option', 'Custom Javascript' section to enable it for the entire site.

//Adds the ability to link to tabs
jQuery(document).ready(function () {
   var activeTab = jQuery('[href=' + location.hash + ']');
   activeTab &&'show');

For example, to link to the "Finding Scholarly Research" tab on the 'Scholarly vs. Popular Sources' page,, use this link -

See Also

How do I add JavaScript files on each page of my site?