本文介绍了带有amp状态和amp-position-observe的AMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在结合amp状态和amp-position-observe的AMP中遇到问题.

I have a problem in AMP combining amp-state and 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>

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

This code return a strange error:

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

推荐答案

amp-position-observer当前无法与amp-state结合使用.只有amp动画和某些视频组件才能与amp-position-observer(文档).

amp-position-observer currently cannot be combined with amp-state. Only amp-animation and some video components can be combined with amp-position-observer (docs).

这篇关于带有amp状态和amp-position-observe的AMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 00:16