Left sidebar active link positioning

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #10038827
    itsmeypk
    Participant

    Hi,

    First of all, thank you for the excellent template, and it is incredible.

    Coming to the issue , in the left sidebar, I have added the multiple toggle sections and making active link id=”activeLink” dynamically through JS code and using the below code to scroll to acive link.
    $(window).on('load', function(){
    $('#sidebar').animate({
    scrollTop: $('#activeLink').offset().top - 64
    }, 300);
    });

    Here I am facing two issues.

    Issue-1: The sidebar scrolling some length but not as expected.
    Issue-2: Scrolling of the left sidebar is resetting when I scroll the mouse for the main content page.

    Would you please help me with the resolution for the two issues?



    Template Version: 9.0.0
    #10038832
    Support
    Keymaster

    Hello,

    Sorry but I’m note sure how to reproduce the issue you mentioned in the ticket but here’s what you can try:

    $(window).on('load', function(){
    	setTimeout(function(){
    		$('#sidebar').animate({
    			scrollTop: $('#activeLink').offset().top - 64
    		}, 300);
    	, 1000);
    });

    Put a setTimeout to scroll after the toggles open. Also change the number 64 if you need.

    Issue 2 I could not understand. Sorry.

    Regards.

    Okler Themes


    #10038836
    itsmeypk
    Participant
    This reply has been marked as private.
    #10038840
    Support
    Keymaster

    Hi,

    Try to change from the animate and use this code:

    $(window).on('load', function(){
    	setTimeout(function(){
    		$('#sidebar').scrollTop($('#activeLink').offset().top - 64);
    	, 1000);
    });

    Remove that old one with $(‘#sidebar’).animate({

    Let me know if you have any questions.

    Kind Regards,

    Jonas


    #10038843
    itsmeypk
    Participant
    This reply has been marked as private.
    #10038846
    Support
    Keymaster

    Hello,

    The problem is that you are using the pin wrapper that is activated with scroll, so simulate scroll on page load:

    $(window).on('load', function(){
    	setTimeout(function(){
    		window.scrollTo(window.scrollX, window.scrollY - 1);
    		window.scrollTo(window.scrollX, window.scrollY + 1);
    	, 500);
    
    	setTimeout(function(){
    		$('#sidebar').scrollTop($('#activeLink').offset().top - 64);
    	, 1000);
    });

    Change the css to make the sidebar the size of the screen:

    .pin-wrapper,
    #sidebar:not(.sticky-active) {
        height: auto !important;
    	max-height: 100% !important;
    }
    
    html.sticky-header-active #sidebar {
    	max-height: 100% !important;
        height: 81vh !important;
    }
    
    html.sticky-header-active #sidebar {
        height: 93vh !important;
    }

    Regards.

    Jonas


    #10038848
    itsmeypk
    Participant
    This reply has been marked as private.
    #10038854
    Support
    Keymaster
    This reply has been marked as private.
    #10038856
    itsmeypk
    Participant

    Thank you..


Viewing 9 posts - 1 through 9 (of 9 total)

This topic is marked as "RESOLVED" and can not rceive new replies.