2016-09-26 4 views
0

私はアプリケーションに取り組んでいますが、スライダにはスライダがありますがスライダには1つのスライドショーに2つの画像があります。記録が、問題はそれが箱の上に同じ画像を示すことで、私は一つのループ2つの画像を1つのスライドショーに表示するには

で次のデータを得ることができる方法を知ってはいけない、ここでコード

<div class="carousel-inner">   
    <?php if($blog) : $counter = 0; foreach($blog as $blogs) : $counter++; ?> 
    <?php if($counter === 1) : ?> 
    <div class="item active"> 
    <?php else : ?> 
    <div class="item"> 
    <?php endif; ?> 
     <div class="row"> 
      <div class="col-md-6"> 
       <div class="panel"> 
        <div class="panel-heading"> 
         <h3> 
          <a href="#"> <?php echo substr($blogs -> heading, 0, 30); ?> </a> <br> <br> <br> 
          <p> <?php echo substr($blogs -> description, 0, 300); ?> <br><br> 
          <a href="#" class="link">Read the full story</a> </p><br> 
          <img src="<?php echo base_url().$blogs -> image; ?>"> 
         </h3> 
        </div> 
       </div> 
      </div> 
      <div class="col-md-6"> 
       <div class="panel"> 
        <div class="panel-heading"> 
         <h3> 
          <a href="#"> <?php echo substr($blogs -> heading, 0, 30); ?> </a> <br> <br> <br> 
          <p> <?php echo substr($blogs -> description, 0, 300); ?> <br><br> 
          <a href="#" class="link">Read the full story</a> </p><br> 
          <img src="<?php echo base_url().$blogs -> image; ?>"> 
         </h3> 
        </div> 
       </div> 
      </div> 
     </div><!--.row--> 
    </div><!--.item--> 
    <?php endforeach; endif; ?> 

</div><!--.carousel-inner--> 
    <a data-slide="prev" href="#blog" class="left carousel-control">‹</a> 
    <a data-slide="next" href="#blog" class="right carousel-control">›</a> 
</div><!--.Carousel--> 

enter image description here

上記の結果です2番目の画像を次のデータにしたいデシベル

+0

$ blogs - >見出し対$ blogs [1] - >見出し – Danimal

+0

の出力が異なるかどうかを確認してください。エラー –

+0

あなたのブログのプラットフォームは何ですか? – Danimal

答えて

0

はこれを試してみてください。

<div class="carousel-inner">   
<?php if($blog) : $counter = 0; foreach($blog as $blogs) : $counter++; ?> 
<?php if($counter === 1) : ?> 
<div class="item active"> 
<?php else : ?> 
<div class="item"> 
<?php endif; ?> 
    <div class="row"> 
     <div class="col-md-6"> 
      <div class="panel"> 
       <div class="panel-heading"> 
        <h3> 
         <a href="#"> <?php echo substr($blogs -> heading, 0, 30); ?> </a> <br> <br> <br> 
         <p> <?php echo substr($blogs -> description, 0, 300); ?> <br><br> 
         <a href="#" class="link">Read the full story</a> </p><br> 
         <img src="<?php echo base_url().$blogs -> image; ?>"> 
        </h3> 
       </div> 
      </div> 
     </div> 
    <?php endforeach; endif; ?> 

何の出力あなたがこれを投稿する場合は?

+0

okループを止めれば、1つのスライドに2つの画像を表示する方法は次のようになります。http://i.stack.imgur.com/9EEhj.png –

+0

2番目の画像は次のようにしてはいけません最初の –

関連する問題