ScrollReveal.js won't function as intended

https://i.stack.imgur.com/SOQEk.png

Looking to utilize the popular ScrollReveal.js created by Julian Lloyd (ScrollReveal)

Despite following instructions from various sources, the script is not producing the intended effect.

Steps taken to make it work:

Added .js file and initialized the script:

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

Added data-sr attribute for each element

    <div class="wrapper">

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

Even after verifying the correct path, the script is not functioning properly.
                <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, witnessing the remarkable growth of the country.</br></br>

                Over the years, we have assisted businesses of all sizes, guiding them through the business landscape of Mozambique and gaining valuable insights into the evolving dynamics of the market.</br></br>

                While Mozambique has experienced growth driven by industries and infrastructure projects, there are opportunities for small and medium-sized enterprises. Its strategic location and vast coastline 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>

Answer №1

It appears that the data-sr attribute is not a recognized feature of this plugin. Upon reviewing the code for version 3.1.4, I could not locate any reference to this attribute.

Your current implementation may be failing due to uninitialized elements that are meant to be revealed.

To address this issue, consider inserting the following code into your document:

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

// Add additional elements as needed
sr.reveal('#other-element');
sr.reveal('#another-element');

For demonstration purposes, I have prepared a fiddle: https://jsfiddle.net/82n10mk4/.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

There seems to be a glitch preventing Highchart from functioning within a jQuery function

Hello there! I'm currently utilizing the highchart API to generate graphs in a loop. for(i=1;i<10;i++) { xseries = "{'INCOPAV','B&M','SGS-ETSA'}"; yseries = "[{name: &apos ...

Ways to prevent blank class from occupying space until filled with Javascript

I've been working on a checkout calculator using JavaScript, and here's how I'm inputting the data: <p class="car-rent-class-info h6 pb-1"></p> <p class="car-rent-pickupdropoff-info h6 pb-1"></p> <p class="car-ren ...

Having trouble with the clip-path in d3.js liquid fill gauge

Attempting to integrate the d3.js liquid fill gauge into my angular2 webapp has been a challenge. The clippath functionality seems to be malfunctioning, resulting in no wave being generated at all. https://i.stack.imgur.com/3Bmga.png instead of https://i. ...

Is there a way to control the visibility of two divs depending on which one a user hovers on?

Having two stacked div elements containing images, I want the div with id = "features3_HDS_image" to become visible when a user hovers over the div with id = "HDS_Blurb", and the div with id = "features3_FH_image" to be displayed when hovering over the div ...

What is the best way to include an attribute to an object in a knockout observable array and ensure a notification is triggered?

Implementing Knockout.js in my project, I have an observable array included in the view model. function MyViewModel() { var self = this; this.getMoreInfo = function(thing){ var updatedThing = jQuery.extend(true, {}, thing); ...

Split the page in half with a background image on one side and text on the other

Is there a way to split the page vertically, with a background image on one side and text on the other? I've been struggling to achieve this layout - the background image won't stay on the left while the text remains on the right. Can someone off ...

What's the best way to set up server-side pagination for mui-datatable?

Is server-side pagination for mui-datatable implementation a complex task? Challenges: I am facing difficulties in capturing the user-selected value from the rowsPerPage options. When a user selects '15', how can I update these values within ...

Implementing real-time data updates on a webpage using Node.js

Currently, I am faced with the challenge of updating values on my page in real-time without the need for constant webpage refreshing. To illustrate, consider a scenario where a user filters a real estate website by location and receives results showing the ...

What is preventing me from choosing the complete table?

I am currently working on a method to export tabular data from an HTML page to Excel using DocRaptor. My approach involves using PHP to pass the necessary data through their API for conversion into an Excel Spreadsheet. However, I have encountered an issu ...

Animated jQuery carousel with a timer countdown feature

Currently, I am developing a jquery slider/carousel to display various promotions. I am seeking a method to indicate the time left until the next promotion appears. Similar to the flash promo on this website: Do you have any suggestions? ...

Display hidden text upon clicking using React Material UI Typography

I have a situation where I need to display text in Typography rows, but if the text is too long to fit into 2 rows, ellipsis are displayed at the end. However, I would like to show the full text when the user clicks on the element. I am attempting to chang ...

Exploring the power of NodeJS modules through exports referencing

Encountering difficulties referencing dynamic variables related to mongoose models based on user session location value. Two scripts are involved in this process. The first script is called location.js & reporting.js In the location.js script: module.ex ...

What is the proper method for utilizing the "oneOf" keyword in this schema?

Is it possible to have either option A or B, but not both (mutually exclusive)? In Draft 3, I am required to use whatever is available, even though the version on top says 4. This is because when using an array for "required", it throws an error stating t ...

NestJs Custom Validation Pipe: Exploring the Possibilities with Additional Options

I have created a unique custom validation pipe and I am looking to enhance it with additional custom logic. How can I extend the pipe to allow for the options listed below? After reviewing the Github link provided, I have implemented my own version of the ...

Data is not loaded until after the HTML for the Nuxt page has been

My issue is that I have a dynamic page where product details are loaded, but the html code loads before the data. This results in errors when trying to use static elements like images because the "product" object does not exist. To address this problem, I ...

What is the CoffeeScript alternative for () => { return test() }?

Currently, I am attempting to write this code in CoffeeScript and finding myself at a standstill... this.helpers({ events: () => { return Events.find({}); } }); ...

What is the purpose of using double % in Java or JSP?

Yesterday, while reviewing some code, I came across a line that seemed very peculiar to me. In a JavaScript function, there is a condition checking for a string passed as a parameter in the following manner: "%%unsubscribe%%". See the snippet below for re ...

Only perform the Rails ajax call once initially

I'm currently working on creating a drop down menu that contains a substantial amount of content, and I would like to use an ajax get call to load everything upon mouse enter. Here is my code written in coffeescript: class @SecondaryMenu construct ...

What is the best method for converting input files into FormData?

I recently created a form that allows users to upload both an audio file and an image file simultaneously. However, during testing, I noticed that the alert only displays basic data and does not include the form data. function PodcastUpload({ data }) { ...

Implementing JavaScript Code in TypeScript

Every JavaScript code should also be valid in TypeScript, but when attempting to run the following code snippet below, an error is triggered. Could someone convert this JavaScript code into TypeScript? Error: 20:9 - TS2531 Error: Object is possibly 'z ...