Metro Carousel,当超过6件物品时滑动混合

时间:2016-06-03 10:27:30

标签: jquery jsp microsoft-metro carousel slide

经过多年的搜索,每次找到答案,我都会遇到一个没有答案的问题。

我正在使用JSP开发动态Web项目。我需要在旋转木马中创建尽可能多的瓷砖,就像我在数据库中一样。这是我的第一个项目之一。

然后我在DB上请求我的数量,然后我有所需的瓷砖数量。 但是当我的数据库返回超过6行,超过6个evenement时,我的旋转木马正在混合我的不同幻灯片。 我正在使用jQuery和metro框架(CSS和JavaScript)。

这是我的代码:

 div class="carousel" id="carousel" data-role="carousel" data-markers="false"  data-auto="false" style="height: 95%;">
 <% 
 while (Incr_slide < Nb_slide){ // Here i compare number of sldiecreated to he      n     number  of slide needed ( i calculated it on antoher class) 

        if(Incr_slide!=Nb_slide ){ // here  it's my loop to do  the right number of slide 
            Incr_tuile=0;

            %>

            <div class="slide" style="margin: 1% 5% 1% 5%;">
                // i create start of slide 


              <%

              if ( Nb_Evt-Incr_tuile_cree>3)
                  x=4;

              else
                  x= calc_tuile_der_slide;
               // I display 4 tiles by slide, then i look if there is 4 tiles or more to display  , if not i display the good number of slide we have left 


            while(Incr_tuile<x){
                request.setAttribute("evt", Incr_tuile_cree);
                %> 

                <jsp:include page="tuile.jsp">
                    <jsp:param name="param" value="${evt}"/>
                </jsp:include>
                 <%
                // here i diplay my tile.jsp , i send evt to take the good info in my database ( name , hour ,etc of this evt ) 


                 Incr_tuile++; // count the number of tiles creat in this loop 
                 Incr_tuile_cree++; // count the number of tile created since the start 
                 System.out.println("crea tuile : "+Incr_tuile_cree);
                 System.out.println("----------");
            }
            Incr_slide++;

            System.out.println("crea slide : "+Incr_slide);
             System.out.println("----------");
            %></div> <%
            }


}

%>
</div>

我不知道我做错了什么。

当我得到少于6个元素时,我的旋转木马工作得很好,但当我得到超过6个瓷砖时,它会混合所有滑块。无论幻灯片的数量是多少。

当我获得超过6件物品时,我的旋转木马,我按日期订购了我的evenement

当我的旋转木马中只有5件物品(第二张幻灯片完美无缺)时,它看起来像这样。

我在这里接受你的所有评论,如果你有疑问,请不要犹豫;)

0 个答案:

没有答案