2013-03-14 28 views
0

我在我的頁面上使用Galleria時出現此錯誤 我之前創建了一個測試頁面,並且工作完美。但是,我需要在主 的內容頁面上使用它,所以當我將所有數據都帶過來時,它給出了這個錯誤。 它加載與圖片列表視圖,而不是GALLERIA 請幫初始失敗:Galleria找不到元素「#runPics」

<html xmlns="http://www.w3.org/1999/xhtml"> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN"> 
<script type="text/javascript" src="../galleria/galleria-1.2.9.min.js"></script> 
<script type="text/javascript" src="../galleria/themes/classic/galleria.classic.min.js"></script> 
<link type="text/css" rel="stylesheet" href="../gallerai/themes/classic/galleria.classic.css" /> 

<style > 
    #galleria 
    { 
     width: 700px; 
     height: 400px; 
     background: #000; 
    } 
</style> 
<style > 
    .body 
    { 
     width: 700px; 
     height: 500px; 
    } 
</style> 


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="select i.imageID, g.Title, i.[Image Title], i.[Image] from Images i, Gallery g where g.ID = i.[Gallery ID]"></asp:SqlDataSource> 

    <div style="width: 700px; text-align: center; height: 500px"> 
     <div id="runPics" runat="server"> 
     <br /> 
     <br /> 

     <asp:ListView ID="lstPics" runat="server" DataSourceID="SqlDataSource1"> 


      <ItemTemplate> 
       <td> 

        <Club:ImageThumbnail ID="ImageThumbnail2" runat="server" PhotoID='<%# Bind("imageID") %>' /> 

       </td> 
      </ItemTemplate> 
     </asp:ListView> 
    </div> 
</div> 

<%-- <div id="galleria"> 
    <img src="../images/1.jpg"> 
    <img src="../images/3.jpg"> 
    <img src="../images/4.jpg"> 
    <img src="../images/5.jpg"> 
    <img src="../images/6.jpg"> 
    <img src="../images/7.jpg"> 
</div>--%> 

<script > 
    //$('#gallery').galleria({ 
    // width: 700, 
    // height: 400 
    //}); 
    //Galleria.loadTheme('../galleria/themes/classic/galleria.classic.min.js'); 
    Galleria.configure({ 
     transition: 'fade' 

    }); 
    Galleria.run('#runPics', { 
     autoplay: 5000 
    }); 
    Galleria.ready(function (o) { 
     var gallery = this, 
      p = !!o.autoplay; 
     this.$('thumbs,more').click(function() { 
      gallery.pause(); 
     }); 
     this.$('desc,thumbnails').click(function() { 
      p && gallery.play(); 
     }); 
    }); 

</script> 
    </html> 

這一切都是其間的一個ASP:內容標籤

回答

0

固定它

改變web.config中:System.Web程序 頁controlRenderingCompatibilityVersion = 「3.5」 的ClientIDMode = 「靜態」/>

並取消了TD>在我的列表視圖標籤