Skip to content

Instantly share code, notes, and snippets.

View vejnoe's full-sized avatar

Andreas Vejnø Andersen vejnoe

View GitHub Profile
@vejnoe
vejnoe / tabs-triggered-by-url-webflow.html
Last active October 30, 2020 08:23
Acticating the Tab with the same name as the #hash from the URL - Webflow
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
// Getting the #hash from the URL
var url = window.location.hash;
// Removing the # symbel
var tab = url.substr(1);
// Acticating the tab with the same name as the #hash from the URL
$('.w-tab-menu > a[data-w-tab="' + tab + '"]').click();
});
<input type="hidden" id="from-url" name="From URL" value="JS not run 😬">
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
$('#from-url').val(window.location.href);
});
</script>
_wrappers.so