A
A
alex steel2018-12-11 11:33:33
Slider
alex steel, 2018-12-11 11:33:33

Why is the carousel scrolling not working in ACF Gallery+bootstrap carousel?

Actually, there is a gallery created through ACF Pro, which is displayed on the page through a repeater, since there are several galleries on one page. I want to blow it so that it is possible to scroll through the pictures and view the full-sized one by clicking in the modal window
. In the modal window, it works through fancybox, but scrolling works only on the first slider on the second one and does not scroll further. I am attaching the
code that I try to add a gallery to.
page with an example https://alptravel.com.ua/tour/test-repiter

<?php 

$images = get_sub_field('daysgalary');
$count=0;
$count1=0;

if($images) : ?>
<div id="slider">
    <div id="carousel" class="carousel slide">
      <ol class="carousel-indicators">
      	<?php foreach( $images as $image ): ?>
        <li data-target="#carousel" data-slide-to="<?php echo $count; ?>" <?php if($count==0) : ?>class="active"<?php endif; ?>></li>      
        <?php 
    $count++;
        endforeach; ?>
      </ol>

      <div class="carousel-inner">
      	<?php foreach( $images as $image ): ?>
            <div class="item<?php if($count1==0) : echo ' active'; endif; ?>">
            	<a href="<?php echo $image['sizes']['large']; ?>" class="fancybox img-<?php echo $counter; ?>" rel="mini">
                <img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />    
                </a>            
            </div>
        <?php 
        $count1++;        
        endforeach; 		
        ?>       
      </div>
    </div>
            <a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
</div>
<?php endif; ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-12-11
@apisklov

you have two identical id's on the page<div id="slider">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question