Skip to content

Instantly share code, notes, and snippets.

@lots0logs
Created April 7, 2016 23:49
Show Gist options
  • Save lots0logs/b4918453e8d23f43b3a1d5355573f0c9 to your computer and use it in GitHub Desktop.
Save lots0logs/b4918453e8d23f43b3a1d5355573f0c9 to your computer and use it in GitHub Desktop.
WordPress :: Divi Theme :: Scroll-To Anchor Inside Tab Module
<script>
(function($) {
$(window).load(function() {
setTimeout(function() {
var hash = window.location.hash,
$tab = $(hash).parents('.et_pb_tab');
if ('' !== hash && $tab.length) {
var $tab_controls = $tab.parent().prev(),
tab_class = $tab.attr('class').replace('et_pb_tab clearfix ', ''),
$tab_control = $tab_controls.find('.' + tab_class);
$tab_control.find('a').trigger('click');
setTimeout(function() {
et_pb_smooth_scroll($(hash), false, 800, 'linear');
}, 500);
}
}, 900);
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment