Last active
December 14, 2022 09:57
-
-
Save wplit/0cc261359e17e7cb9140fb56b2412e47 to your computer and use it in GitHub Desktop.
Allow hash links to open tabs in Oxygen (read comments for instructions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Many thanks!!! All working except. If I have link trigger on the same page this doesn't work for me. But works perfect if links on the other pages. Any solution to fix that?