gpt4 book ai didi

javascript - ScrollReveal.js 不会运行

转载 作者:行者123 更新时间:2023-11-30 16:06:01 26 4
gpt4 key购买 nike

enter image description here

我正在尝试使用 Julian Lloyd ( ScrollReveal ) 编写的广受赞誉的 ScrollReveal.js

我已经按照页面和其他网站上的说明指南进行操作,但是脚本没有提供预期的效果,事实上,没有任何效果。

我添加了以下内容以使其工作:

添加 .js 并初始化脚本:

    <head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<title>Aries Sercon Lda - Accounting, Tax and Consulting in Mozambique - Home</title>
<meta name="description" content="Aries Sercon is an established firm providing accounting, tax and human resource services in Mozambique">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="img/png" href="favicon-32x32.png" sizes="32x32"/>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,900' rel='stylesheet' type='text/css'>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="scripts/scrollReveal.min.js"></script>
<script>
window.sr = new scrollReveal();
sr.reveal('#landing');
sr.reveal('#checks');
sr.reveal('#process');
sr.reveal('#clients');
sr.reveal('#footer');
</script>
</head>

为每个元素添加了引用(“data-sr”)

    <div class="wrapper">

<div class="checks" id="checks" data-sr>

With all these, it does not work. I have checked the path which is correct.
<p class="promo center">We are an independent group of accountants and tax professionals based in Mozambique. We have been operating in the market for over 30 years, long enough to witness and be part of the incredible growth of the country.</br></br>

Together we have helped small and large businesses, novices and even veterans in finding and setting up a space for them in Mozambique, and in doing so have developed an acute understanding of the country's changing business dynamics.</br></br>

Mozambique has seen consistent growth through a decade-long trend strongly driven by the extractive industries and large infrastructure projects. However, opportunities exist for small and medium size business ventures. A long coastline and an ideal geographic location also make it attractive for investment and trade.</p>

<a href="#process" class="smoothScroll"><img src="assets/arrow.svg" class="arrows" alt="Go down"></a>

</div>



</div>

最佳答案

我不认为使用 data-sr 属性是使用此插件的有效方式。我没有在插件代码中找到这个属性(版本 3.1.4)。

您的代码无法正常工作,因为应“显示”的元素未初始化。

尝试将以下代码粘贴到您的文档中:

window.sr = ScrollReveal();
sr.reveal('#checks');

// if you have other elements, add them like this
sr.reveal('#other-element');
sr.reveal('#another-element');

我还为演示创建了一个 fiddle :https://jsfiddle.net/82n10mk4/ .

关于javascript - ScrollReveal.js 不会运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37034927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com