如果我位于幻燈片的開頭或結尾,如何更改 svg 箭頭的顏色?如果值等于 0,也許我可以添加類?如果沒有剩余幻燈片,不確定如何添加課程?下圖是我想要實現的目標。atm 我的兩側都有兩個白色箭頭。我想在開始時(左側)和結束時(右側)將顏色更改為灰色。 $(".image_carousel-wrapper").each(function () { var _this = $(this); var $status = _this.find('.slide-number'); var $slickElement = _this.find('.image_carousel'); $slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { //currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based) if (!slick.$dots) { return; } var i = (currentSlide ? currentSlide : 0) + 1; $status.text(i + '/' + (slick.$dots[0].children.length)); }); var _this = $(this); _this.find('.image_carousel').slick({ arrows: true, dots: true, pauseOnHover: false, pauseOnFocus: false, autoplay: false, swipeToSlide: true, fade: true, draggable: true, prevArrow: _this.find('.prev-slide'), nextArrow: _this.find('.next-slide'), }); }); <div class="image_carousel-wrapper"> <div class="image_carousel"> <?php foreach( $images as $image ): ?> <div class="slide"> <img class="full-width <?php if($module_alignment == 'left') : ?>left-image<?php endif; ?>" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>"> <?php if( get_sub_field('artists_impression') ): ?> <p class="artistimp ">Artist Impression</p> <?php endif; ?> </div>
- 1 回答
- 0 關注
- 129 瀏覽
添加回答
舉報
0/150
提交
取消