afx 中的 Neos CMS 脚本由于某种原因不起作用

Neos CMS script in afx doesn't work for some reason

我是 Neos CMS 的新手。我正在尝试为 file.fusion 中的一些 HTML 容器制作动画,完全在 afx 中。 JavaScript 代码是正确的,但在 file.fusion 中不起作用。 看来 afx 忽略了我的 .

我将与您分享我的代码,感谢您的帮助:

    renderer = afx`
    <div id="serviceFour" class="container">
        <div class="row">
            <div class="col-lg-6">
                <div class="text-left mt-5">
                    <h6 class="subtitle">About</h6>
                    <h2 class="title">Trusted Services</h2>
                    <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nisi ante, luctus eu elit sit amet, venenatis sagittis urna. Morbi eget laoreet dui. Nulla sed nulla congue, feugiat tor</div>
                </div>

                <div class="row mt-4">
                    <div class="col">

                        <div class="box-number">
                            <div class="box">
                                <div class="num">9</div>
                            </div>
                            <div class="box-desc">A</div>
                        </div>

                        <div class="box-number">
                            <div class="box pt-3">
                                <div class="num">1000</div>
                            </div>
                            <div class="box-desc">B</div>
                        </div>


                    </div>

                    <div class="col">

                        <div class="box-number">
                            <div class="box">
                                <div class="num">200</div>
                            </div>
                            <div class="box-desc">D</div>
                        </div>

                        <div class="box-number pt-3">
                            <div class="box">
                                <div class="num">110</div>
                            </div>
                            <div class="box-desc">C</div>
                        </div>
                    </div>
                </div>
            </div> 
        </div>
    </div>

    <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.js'></script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.js'></script>
    <script src='/_Resources/Static/Packages/Example/ExampleTwo/ExampleThree/function.js'></script>
    
`

}

我假设您的 function.js 文件未正确加载。如果您的 function.js 加载正确,您是否检查过浏览器网络选项卡?

此外,您不应将此硬编码路径用于 Neos 静态文件。使用类似:

<script src={StaticResource.uri('My.Package', 'Public/Scripts/Main.js')}></script>

还要确保您的资源已发布:

./flow resource:publish