【问题标题】:AMP with amp-state and amp-position-observe具有 amp-state 和 amp-position-observe 的 AMP
【发布时间】:2018-01-17 08:15:37
【问题描述】:

我在 AMP 结合 amp-state 和 amp-position-observe 时遇到问题。

<amp-state id="myState">
    <script type="application/json">
        {
            "visible": "n"
        }
    </script>
</amp-state>


<amp-state id="variableChange">
    <script type="application/json">
        {
            "visible": "y"
        }
    </script>
</amp-state>

<amp-position-observer on="enter:variableChange"
        layout="nodisplay">
</amp-position-observer>

这段代码返回一个奇怪的错误:

url.js:348
Trust for 'activate' (1) insufficient (min: 100).​​​

【问题讨论】:

    标签: html amp-html


    【解决方案1】:

    amp-position-observer 目前无法与 amp-state 结合使用。只有 amp-animation 和一些视频组件可以与 amp-position-observer (docs) 结合使用。

    【讨论】:

    • 好的,谢谢,我会用 amp-position-observer 向 div 添加类,可以吗?
    • @SebastianBenz 也是同样的问题 - stackoverflow.com/questions/55101350/… - 我们现在能做到吗?
    • 还是不行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-19
    • 1970-01-01
    相关资源
    最近更新 更多