0

I want to display all tab contents in page load.

If I click the tab, then page scroll to the corresponding content.

How to do that.

Thanks.

1

You want to use javascript

Something like this

https://stackoverflow.com/a/41121797/10121426

Assuming that your href attribute is linking to a div with the tag id with the same name (as usual), you can use this code:

HTML

<a href="#goto" class="sliding-link">Link to div</a>

<div id="goto">I'm the div</div>

JAVASCRIPT - (Jquery)

require(['jquery', 'jquery/ui'], function($){
  $(document).ready( function() {
    $(".sliding-link").click(function(e) {
        e.preventDefault();
        var aid = $(this).attr("href");
        $('html,body').animate({scrollTop: $(aid).offset().top},'slow');
    });
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.