0

I have a carousel slider with one img and YouTube embed video. I want to set different data-interval on img "5000" and youtube"102000" video but its not working for my carousel slide. can you please help me.

<?php $hero=carbon_get_theme_option('herosection');if($hero){?>
<section class="herovideo">
  <div id="myCarouselmain" class="carousel slide" data-ride="carousel"  >
    <ol class="carousel-indicators">
      <?php $herocount=0; foreach($hero as $item){?>
      <li data-target="#myCarouselmain" data-slide-to="<?php echo $herocount?>" class="<?php if($herocount==false){echo "active";}?>"></li>
      <?php $herocount++;}?>
    </ol>
    <div class="carousel-inner">
      <?php $herocount2=0; foreach($hero as $item){?>
      
        <?php   if($item['herovideo'] == false){?>
          <div class="carousel-item <?php if($herocount2==false){echo "active";}?>"data-interval="9000">
        <img class="d-block w-100" src="<?php echo $item['heroimage'];?>" alt="image slide">
  
          <div class="carousel-cap ">
            <h5><?php echo do_shortcode($item['herotitle']);?></h5>
    <p class="lore"><?php echo do_shortcode($item['herodesc']);?></p>
            <a href="<?php echo $item['herodescbtntxur1'];?>" class="btn btnhero"><?php echo $item['herodescbtntx1'];?></a>
            <a href="<?php echo $item['herodescbtntxtxur2'];?>" class="btn btnhero 2nd"><?php echo $item['herodescbtntxtx2'];?></a>
          </div>
        </div>
        <?php } $herocount2++;}foreach($hero as $item){ ?>
    
<?php if($item['herovideo'] == true){?>
        <div class="carousel-item " data-interval="90000" id="myCarousel" >
 
            
            <iframe  class="d-block  w-100 videoslider" data-interval="90000" src="<?php echo esc_url($item['herovideo']);?>?autoplay=1&mute=1&rel=0&vq=720&loop=1&playlist=uLtGW2Aexjw" title="YouTube video player" frameborder="0" allow=" accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" width="100%" allowfullscreen="allowfullscreen" ></iframe>
        
        
      </div>

        <?php }
        ?>
  <?php }?>

    </div>
  </div>
</section>
<?php }?>

0 Answers0