Imprint as accordion at bottom of page does not scroll up when clicked

Hello team,

i have created an imprint at the bottom of a website as a accordion.

When it is clicked the accordion stays steady but i want it to scroll up.

i have tried different codes in the global java script, but could not achieve what i want.

Can you please help me.

I will send the url in the next message

Thanks in advance.

Best regards,
Ingo

Hello There,

Thanks for writing in! To resolve this, please edit your page back in Cornerstone and in Cornerstone custom js section, Custom JS, insert the following custom js code

jQuery( function($){
  $(window).on('resize scroll', function( e ) {
  	var yloc = $('#x-section-16').offset().top - 52;
    $('html, body').delay(500).animate({
        scrollTop: yloc
      }, 850, 'easeInOutExpo');
  });
});

Hope this helps.

Thanks for the quick response!

After inserting the code it scrolls automatically to the top, but i can’t scroll upwards anymore, a second scrollbar has appeared and the background is grey.

And the automatic scrolling should stop at a point when you can see the beginning of the accordions content, not the end.

Can you please help me fix the new issues?

Thank you.

Best regards,
Ingo

I solved the problem with the following code:

jQuery(function($){ $(’.x-accordion-toggle’).click(function(){

$(‘html,body’).animate({
scrollTop: $(this).offset().top - $(’.x-navbar’).height()
},700 ,‘swing’);

}); });

Hello @Ingo,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

All the best.