【问题标题】:Init failed: Galleria could not find the element "#runPics"初始化失败:Galleria 找不到元素“#runPics”
【发布时间】:2013-03-14 07:26:53
【问题描述】:

我在使用 Galleria 的页面上出现此错误 我之前创建了一个测试页面,它运行良好。但是现在我需要在 master 的内容页面上使用它 所以当我把所有数据都带过来时,它给出了这个错误。 它用图片加载列表视图,但不加载画廊 请帮忙

<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:content 标签之间

【问题讨论】:

    标签: html init galleria


    【解决方案1】:

    修好了

    将 web.config 更改为:system.web 页面 controlRenderingCompatibilityVersion="3.5" clientIDMode="Static" />

    并删除了我的列表视图中的 td> 标签

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      • 2016-03-25
      • 2012-11-17
      • 2017-12-10
      相关资源
      最近更新 更多