Join

Listing Feed Carousel Autoplay

Don't want to mess with code snippets? Request for this to be a feature of MyListing Pro.

Instructions

  1. Create a new JS code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

If you use Listing Feeds in Carousel mode, this snippet allows those feeds to scroll to the left automatically.

jQuery(document).ready(function($){
    setTimeout(function() {

        if ( $(' .listing-feed-carousel .owl-item' ).length ) {

            $( ' .listing-feed-carousel').trigger('destroy.owl.carousel');
            $( " .listing-feed-carousel").owlCarousel({
                loop: true,
                margin: 20,
                items: 3,
                autoplay: true,
                autoplaySpeed: 500,
                smartSpeed: 10000,
                fluidSpeed: 10000,
                responsive: {
                    0: {
                        items: 1,
                        margin: 0
                    },
                    768: {
                        items: 2
                    },
                    1e3: {
                        items: 3
                    }
                }
            });
            $( ' .listing-feed-carousel').trigger('refresh.owl.carousel');
        }
    }, 1);
});