Code-snippet problem for accordion
-
Hi, I have a question about a script/code created by or shared by a certain Ben here on the forum.
I want the accordion topic you open to be at the top of the screen because that way, you don’t have to scroll al the way back up if you open the second one and so on..
It works great but because I use a header-plugin that makes the header sticky, the accordion just positions itself under the header.
When I deactivate the plugin (sticky header) it works just fine.Is there a way to add something like “100px from top” to the code?
I don’t understand a thing about coding so I would not know if it’s possible or where and how to put it in..Thank you very much!
<script>
jQuery( document ).ready( function( $ ) {
$( ‘.elementor-tab-title’ ).click( function( ) {
var pane = $(this);
setTimeout(function(){
var $panel = pane.closest(‘.elementor-accordion-item’);
$(‘html,body’).animate({
scrollTop: $panel.offset().top
}, 500);
}, 500 );
});
});
</script>The page I need help with: [log in to see the link]
- The topic ‘Code-snippet problem for accordion’ is closed to new replies.