Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #364979

    We have created an image heavy site and are finding our page speeds for mobile aren’t what they should be. Would you happen to be able to recommend a way to disable the slider (both Easy Slider and Layer Slider) for mobile devices that doesn’t resort to a display:none usage? It’s my understanding that the slider will still load even if it’s not displaying.

    Thanks so much for your help!

    #365153

    Hi wildflowermeadows!

    Thank yo for using Enfold.

    You can use the .remove jquery function. Add something like this on functions.php:

    /**
     * Remove element on mobile device
     */
    
    add_filter('wp_footer', 'avf_remove_element', 10);
    function avf_remove_element() { ?>
    <script>
    (function($){
    		if ($(window).width() <= 768){	
    			$('ELEMENTS TO BE REMOVED HERE').remove();
    		}	
    	
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Ismael

    #365717

    Thank you so much for the quick reply and for the detailed help. We will give it a try.

    #365762

    Please let us know how it goes so we can mark the topic as solved :)

    Cheers!
    Josue

    #366143

    Yes, this worked like a charm. Thanks for your help!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Options for removing sliders from mobile, not just css display:none?’ is closed to new replies.