skip to Main Content

I created a button in Elementor

I created a button in Elementor

I created a menu anchor in Elementor

i created a menu anchor in Elementor

result link search bar

the result is that the anchor works fine but the problem is that I want to remove #layanan on the tesaja.com/#layanan link in the search engine bar to just tesaja.com and the anchor works. How to? Thank You

2

Answers


  1. Try this, replace menu-class with your actual class.

    $(document).ready(function() {
        // Smooth scroll to section when menu item is clicked
        $(".menu-class").click(function(event) {
            event.preventDefault();
            var sectionId = $(this).attr('href');
            #console.log(sectionId);
            var section = $(sectionId);
            if (section.length) {
                $('html, body').animate({
                    scrollTop: section.offset().top
                }, 1000);
            }
        });
    });
    
    Login or Signup to reply.
  2. I tried replicating your issue at my end on Chrome, Firefox and Safari but could not. The default behavior of Menu Anchor does not add anchor at the end of URL. Could you please check if there are any errors in console?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search