Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Accordion issue on website

$
0
0

Replies: 0

Hello!
I’m making accordions with a large amount of text. When you read to the bottom and click the next accordion, the large amount of text is collapsed and I’m left at the bottom of the page.

I’d like to scroll to the top of the specific active panel that is open.

I found this code from internet but don’t know how to apply in Elementor Accordion

<script>
jQuery( document ).ready( function( $ ) {
$( ‘.kt-blocks-accordion-header’ ).click( function( ) {
var pane = $(this);
setTimeout(function(){
var $panel = pane.closest(‘.kt-accordion-pane’);
$(‘html,body’).animate({
scrollTop: $panel.offset().top
}, 500);
}, 300 );
});
});
</script>`


Viewing all articles
Browse latest Browse all 59525

Trending Articles