Clicking on the button I would like to link to a specific tab on IB | Smart? Crazy? Ambitious?. So, I would like to have active the “Jobs” tab to show all the jobs.
Put the code below into Site Settings > Custom Code > Footer Code:
<script>
function getParam(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var Webflow = Webflow || [];
Webflow.push(function () {
var tabName = getParam('tab');
if (tabName) $('.' + tabName).triggerHandler('click');
});
</script>
Append this to the href/URL on the button you are linking from
/pagename?tab=tabclass
Replace pagename and tabclass with slug of the page that the tabs are in. eg. If the tabs are in the ‘about’ page and you want to link to the 2rd tab with a class of ‘secondtab’, then;