Skip to content

Instantly share code, notes, and snippets.

@aleua
Forked from wplit/tab-element.js
Created June 26, 2019 09:15
Show Gist options
  • Save aleua/602eedda64fcd7a81e344e715fcdd270 to your computer and use it in GitHub Desktop.
Save aleua/602eedda64fcd7a81e344e715fcdd270 to your computer and use it in GitHub Desktop.
Allow hash links to open tabs in Oxygen (read comments for instructions)
var hash = window.location.hash.substr(1);
if (hash == '%%ELEMENT_ID%%') {
setTimeout(function(){
jQuery([document.documentElement, document.body]).animate({
scrollTop: jQuery('#' + '%%ELEMENT_ID%%').offset().top - 100
}, 1000);
jQuery('#' + '%%ELEMENT_ID%%').trigger('click');
},1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment