如何在轮播滑块中传递图像循环

时间:2014-10-21 07:28:10

标签: javascript jquery ruby-on-rails-4

这是回形针头像图像的循环。在这里,我想显示图库列表,如图库列表,图像也根据管理员动态更改。 in_groups_of(3)只显示每行三个图像

     <table>
          <% p.images.in_groups_of(3).each do |image| %>
            <tr>
              <%image.each do |img|%>
                <% if img.try(:avatar).present? %>
                  <td>
           <%=image_tag img.avatar.url(:small),:style=>"width:300px;height:300px;" %>

                  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>       
                <%end%>
              <%end%>
            </tr>
          <% end %>
        </table>

    How to combine the carousel bootstrap to the above loop of the paperclip image


    <div class="modal-body">
           <html lang="en">
           <body>
    <div class="bs-example">
        <div id="myCarousel" class="carousel slide" data-interval="3000" data-ride="carousel">
          <!-- Carousel indicators -->
            <ol class="carousel-indicators">
                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                <li data-target="#myCarousel" data-slide-to="1"></li>
                <li data-target="#myCarousel" data-slide-to="2"></li>
            </ol>   
           <!-- Carousel items -->
            <div class="carousel-inner">
                <div class="active item">
                 <h2>Slide 1</h2>
                    <div class="carousel-caption">
                      <!-- <h3>First slide label</h3> -->
                      <!-- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> -->
                    </div>
                </div>
                <div class="item">
                    <h2>Slide 2</h2>
                    <div class="carousel-caption">
                      <!-- <h3>Second slide label</h3> -->
                      <p></p>
                    </div>
                </div>
              </div>
                <div class="item">
                    <h2>Slide 3</h2>
                    <div class="carousel-caption">
                      <!-- <h3>Third slide label</h3> -->
                      <!-- <p>Praesent commodo cursus magna, vel scelerisque nisl consectetur.</p> -->
                    </div>
                </div>
            </div>
            <!-- Carousel nav -->
            <a class="carousel-control left" href="#myCarousel" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></span>
            </a>
            <a class="carousel-control right" href="#myCarousel" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
        </div>
    </div>
    </body>
    </html>

          </div>

    Please some body help me any comment it is appreciated
    *

0 个答案:

没有答案