Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1495565

    Dear team,

    On my page below I use 3horizontal galleries (middle of page)

    I use the option “The chosen image gets enlarged on click”, but it stays enlarged. Only browser refresh resizes it.

    Is there an option to keep the enlargement function, but each pic will automatically resize without browsing refresh?

    Thanks and best regards . Tilman

    #1495609

    Hey Tilman,
    When I check your page the horizontal galleries behave as intended, clicking a image enlarges it until the next one is clicked. It’s true that they stay enlarged. If you want the image size to be restored after 5 seconds, try this function in your child theme function.php file. If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
    fUcTO4R.jpg
    then add the code below and save.

    function restore_horizontal_gallery_size() { ?>
      <script>
    document.querySelectorAll('.av-horizontal-gallery-wrap').forEach(item => {
        item.addEventListener('click', function () {
            clearTimeout(this._galTimer);
            this._galTimer = setTimeout(() => {
                this.classList.remove('av-active-gal-item');
            }, 5000);
        });
    });
    </script>
      <?php
    }
    add_action( 'wp_footer', 'restore_horizontal_gallery_size', 99 );

    Best regards,
    Mike

    #1495652

    hi MIke,
    cool, this works :-)

    thx a lot & best regards Tilman

    #1495670

    Hi,
    Glad that we could help, if you have further questions please open a new thread and we will try to help. Thanks for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘horizontal gallery pic enlarge’ is closed to new replies.