Last active
August 19, 2022 20:20
-
-
Save ignacioribes/740138848d37bb0c305c0d8cb798fb37 to your computer and use it in GitHub Desktop.
Scroll to top tab elementor wordpress
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 type="text/javascript"> | |
// Scroll to tab top | |
jQuery('.elementor-tab-title').on('click', function (e) { | |
var idName = jQuery(this).attr('id'); | |
console.log(idName) | |
setTimeout(function (){ | |
// Code you want to delay or you can call the function reference directly instead of defining one | |
jQuery('html, body').animate({ | |
scrollTop: jQuery("#" + idName).offset().top | |
}, 'slow'); | |
}, 500); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment