Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1363188

    Good afternoon,

    I’ve been seraching on the forum but couldn’t find a solution for this problem :

    I am building a new page on https://www.neon-pro.it/nuova-home-2022/
    On the content slider appearing under “Come possiamo aiutarvi” I would need:
    – to have a fixed height for all the slides (I tried some custom css codes I found in some topics, even deleting the browser cache but it doesn’t work)
    – to have arrows on the left and right side of the slides instead of the little arrows on the upper right corner
    – (if possible) to have the slides with two alternate background colors (one red, one purple, one red, one purple, etc.)

    Thanks a lot.

    #1363215

    This is how we would like the content slider to look:

    Sorry I forgot to upload the layout of the website. Thanks.

    Thanks.

    • This reply was modified 2 years, 3 months ago by neon2020.
    #1363329

    Hi again. Any help on this topic is really appreciated…
    Thanks a lot in advance.

    #1363578

    Hi,

    Sorry for the delay. You can use this script to apply a uniform height to the slides.

    // custom script: set min height to slider
    function ava_custom_script_set_min_height()
    {
        ?>
        <script type="text/javascript">
            (function($) {
                $(document).ready(function() {
                    // Get an array of all element heights
                    function setSlideHeight(element) 
                    {
                        var elementHeights = element.map(function() {
                            return $(this).height();
                        }).get();
                    
                        // Math.max takes a variable number of arguments
                        // <code>apply</code> is equivalent to passing each height as an argument
                        var maxHeight = Math.max.apply(null, elementHeights);
                    
                        // Set each height to the max height
                        element.height(maxHeight);
                    }
                  
    
                    $(window).on( 'debouncedresize', function()
    				{
                        var slider = $('.avia-content-slider-inner');
                        var slider_wrap = slider.find('.slide-entry-wrap');
                        var slides = slider_wrap.find('.slide-entry');
    				  	
                        setSlideHeight(slides);
    				});
                });
            })(jQuery);
        </script>
        <?php
    }
    add_action( 'wp_footer', 'ava_custom_script_set_min_height', 9999 );
    

    To apply alternate background colors to the slides, add this code.

    .avia-content-slider .slide-entry-wrap .slide-entry:nth-child(odd) {
        background-color: red;
    }

    Best regards,
    Ismael

    #1363608

    Ok, the alternate background works perfectly. The only problem is that now I see an alternate background also on the partner/logo element below: https://www.neon-pro.it/nuova-home-2022
    Is there a way we can apply it just to the content slider and not to the partner/logo element?
    Thank you very much.

    #1363619

    Hi,

    Please add following code to Quick CSS field in Enfold theme options > General Styling tab

    
    .avia-logo-element-container.avia-content-slider .slide-entry-wrap .slide-entry:nth-child(2n+1) {
      background: none;
    }
    

    Regards,
    Yigit

    #1363707

    Thanks a lot. It is fine.

    #1363723

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.