"on click scroll down script for menus"
Bootstrap 4.1.1 Snippet by anmolv886

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> </div> </div>
/***This below script is for on click scroll in about us menu or submenu ****/ <?php if(is_page("about-us") && isset($_GET["menu"])){ ?> jQuery(window).load(function() { var menu = '<?php echo $_GET["menu"]; ?>'; jQuery('html, body').animate({ scrollTop: jQuery("#"+menu).offset().top }, 'slow'); }); <?php }?> jQuery(document).ready(function($) { function scrollToSection(section) { console.log(section); var menu = section.split('menu=')[1];; jQuery('html, body').animate({ scrollTop: jQuery("#"+menu).offset().top }, 'slow'); } $('.about_us_menu ul.sub-menu li a').on('click', function(event){ if(jQuery(".about_us_menu").hasClass("current-menu-item")){ event.preventDefault(); var section = $(this).attr('href'); scrollToSection(section); } }); }(jQuery)); /***This above script is for on click scroll in about us menu or submenu ****/

Related: See More


Questions / Comments: