-->

AMP with amp-state and amp-position-observe

2020-07-24 06:07发布

问题:

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).​​​

回答1:

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).



标签: html amp-html