Created
April 7, 2016 23:49
-
-
Save lots0logs/b4918453e8d23f43b3a1d5355573f0c9 to your computer and use it in GitHub Desktop.
WordPress :: Divi Theme :: Scroll-To Anchor Inside Tab Module
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
<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