• Resolved forbi70

    (@forbi70)


    Hello,

    I recently installed EasyAccordion and successfully created a page with it. But before I can publish it, I’d like to know, why opening a new item does not focus on the very item?

    My accordion contents are quite long and when I click to open the next one, the focus remains on the page position and due to the closing prior item most of the content disappears towards the top, so that you have to scroll up to the beginning. See https://lederfuesse.de/accordion-test-page/

    Strangely enough, when I change the browser tab or window and then go back to the accordion page, it suddenly focuses on the recently opened item.

    I get the same behaviour both in Chrome and Firefox browsers.

    I expect it to focus immediately after opening. Any idea?
    Thanks in advance!
    Forbi

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Bayejid Ahmed

    (@bayejid00)

    Hi @forbi70,

    Apologies for the delayed response. Hope you are fine.

    The title background active color and the Multiple opening together options are not available in the current lite version of the plugin. The title background active color can be achieved by tweaking the custom CSS. Please add the following CSS to the plugin’s custom CSS field.

    We have noted the Multiple opening together option to add on the lite version as well on our plugin development roadmap. If it seems logical then it will be included in the future version of the plugin.

    .ea-expand .ea-header {
    background: #46c3c3;
    }

    [Note: Use your desired color code.]

    Hope it will work. Thank you.

    Thread Starter forbi70

    (@forbi70)

    Hello @bayejid00,

    thank you for your answer, but I think you might have misunderstood my question. I don’t care about the color of the active headline. By the way the option “Multiple Opening Together” is working in my installation, too.

    My problem is that I want the single opening, but when I open the next accordion item it jumps far over the top of the page so that the content is only readable when scrolling to the header. I expect a new opening item to position at the top of the page, so that I can read the content from the beginning, without scrolling. That’s what I meant with “focus”.

    Best regards,
    Forbi

    Thread Starter forbi70

    (@forbi70)

    Plugin Support Bayejid Ahmed

    (@bayejid00)

    Hi @forbi70,

    Thank you for explaining. By adding the following PHP code in your current theme functions.php, you can fix this scrolling position like the screenshot.

    // Scrolling position for Easy Accordion
    add_action( 'wp_footer', function () { ?>
    <script>
        (function($){
            $(document).on('ready', function(){
                $('.sp-ea-single>.ea-header a').on('click', function(e){
    				e.preventDefault;
    				var $this = $(this);
    				setTimeout(function(){
    					var targetTop = $this.offset().top - 150 + 'px';
    					$("html, body").animate({ scrollTop: targetTop }, "slow");
    				},  500);
                });
            });
        })(jQuery);
    </script>
    <?php },99 );

    We have noted it in the development roadmap, if it is feasible, it will be included in the future version.

    Let us know if the issue gets resolved or not.

    Thread Starter forbi70

    (@forbi70)

    Hi @bayejid00,

    thank you very much for the quick fix! It does work, see my test page: https://lederfuesse.de/accordion-test-page/

    I adjusted the offset from 150 px to 120 and changed the animation speed from “slow” to “fast”, so it rather meets my needs.

    Thanks again for your support!
    Matthias

    Plugin Support Bayejid Ahmed

    (@bayejid00)

    Hi @forbi70,

    Yes, it is working at my end too. If you like our plugin and support, feel free to share your experience in the review section.

    Have a nice day!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No focus on opened accordion item’ is closed to new replies.