Skip to content

Instantly share code, notes, and snippets.

@onokumus
Last active April 21, 2017 11:36
Show Gist options
  • Save onokumus/e324c703d4dcfc2d294434fa74a59602 to your computer and use it in GitHub Desktop.
Save onokumus/e324c703d4dcfc2d294434fa74a59602 to your computer and use it in GitHub Desktop.
<script src="node_modules/metismenu/dist/metisMenu.js"></script>
<script>
var header_wrap_height = $('.header_wrap').height();
$('.metismenu').metisMenu({
toggle: false,
triggerElement: '.pricing-link',
parentTrigger: '.pricing-item',
subMenu: '.pricing-table'
})
.on('shown.metisMenu', function (event) {
$('body,html').animate({
scrollTop: $(event.target).parent('.pricing-item').position().top - header_wrap_height
}, 600);
});
</script>
<script src="/wp-content/themes/catalyst/node_modules/metismenu/dist/metisMenu.min.js"></script>
<script>
jQuery(document).ready(function () {
var header_wrap_height = jQuery('.header_wrap').height();
jQuery('.metismenu').metisMenu({
toggle: false,
triggerElement: '.pricing-link',
parentTrigger: '.pricing-item',
subMenu: '.pricing-table'
})
.on('shown.metisMenu', function (event) {
jQuery('body,html').animate({
scrollTop: jQuery(event.target).parent('.pricing-item').position().top - header_wrap_height
}, 600);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment