【问题标题】:Galleria software - Could not extract a stage height from the CSSGalleria 软件 - 无法从 CSS 中提取舞台高度
【发布时间】:2011-10-01 04:22:36
【问题描述】:

我遇到错误 - 无法从 CSS 中提取舞台高度:跟踪高度 0px - 当我在 IE8 和 Firefox 6.0.2 中刷新带有 Galleria 画廊的页面时。我进行了以下更改:

1) 通过更改此标签到 html -

 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN" 

2)

增加高度属性
.galleria-stage {height: 467px;}

3) 匹配头部中的以下标签 -

 link type="text/css" rel="stylesheet" href="galleria/themes/classic/galleria.classic.css"
 script type="text/javascript" src="js/galleria-1.2.5.min.js"
 script type="text/javascript" src="galleria/themes/classic/galleria.classic.min.js"

我继续遇到此错误。请帮忙! (我在这篇文章中删除了小于和大于符号,但它们包含在我的代码中)。

谢谢,

瑞克·R.

【问题讨论】:

    标签: galleria


    【解决方案1】:

    根据脚本作者的说法,这个问题已经在最新的测试版中得到修复:https://github.com/aino/galleria/blob/master/src/galleria.js

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,并将 height 属性添加到 galleria.classic.css 并实现了“告诉我甘道夫在哪里”推荐的文件,我的错误消失了。我打算 +1 他的,但我的声誉不够高;)

      【讨论】:

        【解决方案3】:

        不酷的解决方案是在 Galleria 样式的末尾添加

        .galleria-errors{display: none;}
        

        只是忽略错误信息

        【讨论】:

          【解决方案4】:

          实际上,诀窍是在页面中添加高度设置,其余设置与示例中一样 (至少对我来说铬 18.0.1025.168 m)

          <!doctype html>
          <head>
                  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
                  <script src="galleria/galleria-1.2.7.min.js"></script>
                  <style>
                      #galleria{height:467px}
                  </style>
              </head>
              <body>
                  <div id="galleria">
                      <img src="photos/photo1.jpg">
                      <img src="photos/photo2.jpg">
                      <img src="photos/photo3.jpg">
                  </div>
                  <script>
                      Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
                      Galleria.run('#galleria');
                  </script>
              </body>
          </html>
          

          【讨论】:

            【解决方案5】:

            我在 1.2.5 版本中遇到了同样的问题,并通过放置来修复它:

            <!doctype html>
            <head>
            

            在文档的最顶部。希望这对您有所帮助还为时不晚。

            【讨论】:

              【解决方案6】:

              你可以在调用galleria.run('#galleria');之前设置元素的heightwidth。 我有同样的问题,这解决了它。

              【讨论】:

                【解决方案7】:

                那是多么改变心灵的体验!对我来说,这取决于我阅读了哪个安装指南。

                This one 给了我致命错误消息和我所有的试验更改,因为我浏览了一个解决方案。

                This one 让我重新振作起来。我采用了下面的 HTML 并更新了我的文件,使其看起来像这个带有 CSS 条目的版本。它首先起作用。

                <!doctype html>
                <html>
                    <head>
                        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
                        <script src="galleria/galleria-1.2.7.min.js"></script>
                        <style>
                            #galleria{ width: 700px; height: 400px; background: #000; }
                        </style>
                    </head>
                    <body>
                        <div id="galleria">
                            <img src="photo1.jpg">
                            <img src="photo2.jpg">
                            <img src="photo3.jpg">
                        </div>
                        <script>
                            Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
                            Galleria.run("#galleria");
                        </script>
                    </body>
                </html>
                

                【讨论】:

                • 是的,galleria.io/download 页面中链接的初学者指南似乎显示了一个不起作用的示例。在我修改了你提到的代码后,它可以正常工作。
                【解决方案8】:

                我通过打开 javascript 文件 Galleria-1.2.7.js 并将 debug 设置为 false 解决了这个问题。

                25号线左右

                VERSION = 1.27,
                DEBUG = false,
                TIMEOUT = 50000,
                

                【讨论】:

                • 或者只是将其添加为选项并保持向前兼容性。
                猜你喜欢
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2010-10-30
                • 1970-01-01
                • 1970-01-01
                • 2011-10-16
                相关资源
                最近更新 更多