1 2jQuery( document ).ready(function() { 3 4 // Add the "Active" class to the every first carousel item 5 jQuery('.carousel-inner .carousel-item').first().addClass('active'); 6 7 // Create the carousel indicators 8 jQuery('.carousel-indicators').each(function() { 9 thisIndicators = jQuery(this); 10 thisCarousel = jQuery(this).closest('.wp-block-create-block-carousel'); 11 12 jQuery(this).closest('.wp-block-create-block-carousel').find('.carousel-item').each(function() { 13 thisIndicators.append('<li data-target="#' + thisCarousel.attr('id') + '" data-slide-to="' + jQuery(this).index() + '"></li>') 14 }); 15 16 // Make the first carousel indicator active 17 jQuery('.carousel-indicators li').first().addClass('active'); 18 19 jQuery('#playButton').click(function () { 20 jQuery(thisCarousel).carousel('cycle'); 21 }); 22 23 jQuery('#pauseButton').click(function () { 24 jQuery(thisCarousel).carousel('pause'); 25 }); 26 27 }); 28});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.