The initial item in the Materializecss slider is failing to display

Currently, I am attempting to implement materialize slider with skrollr. The setup is functional; however, only the first item of the slider is set to opacity: 0 initially.

https://i.stack.imgur.com/urSww.jpg

After a brief delay, the second item becomes visible.

https://i.stack.imgur.com/DNmm7.jpg

This is the snippet of my HTML code:

<div id="story"
data-0="display: none;"
data-1="display: block; top: 200%;"
data-2000="top: 0%;"
data-3000="top: -100%;"
>
<div id="story-overlay"></div>
<div id="story-title">
        <p class="uppercase">Love Story</p><br>
        <p class="date"><span class="uppercase">September</span> 20th, 2015</p>
</div>

<div id="story-carousel">
    <div class="slider">
        <ul class="slides">
            <li>
                <div class="caption left-align">
                    <h3>How We Met</h3>
                    <h5>Lorem ipsum dolor sit amet...</h5>
                </div>
            </li>

            <li>
                <div class="caption left-align">
                    <h3>How We Met</h3>
                    <h5>Lorem ipsum dolor sit amet...</h5>
                </div>
            </li>

            <li>
                <div class="caption left-align">
                    <h3>How We Met</h3>
                    <h5>Lorem ipsum dolor sit amet...</h5>
                </div>
            </li>

            <li>
                <div class="caption left-align">
                    <h3>How We Met</h3>
                    <h5>Lorem ipsum dolor sit amet...</h5>
                </div>
            </li>
        </ul>
    </div>
</div>

Below is the excerpt from my CSS styles:

#story #story-carousel {
position: absolute;
display: block;
top: 0;
left: 0;
height: 400px;
width: 100%;
z-index: 1;
background-color: transparent;
}

#story #story-carousel .slides {
z-index: 1;
background-color: transparent;
padding: 200px;
padding-top: 20;
}

#story #story-carousel .slides h3 {
font-weight: 100;
text-transform: uppercase;
color: #fff;
}

#story #story-carousel .slides h5 {
padding: 20px;
font-size: 1.1rem;
color: #fff;
font-weight: 100;
}

#story #story-carousel .slider .indicators {
z-index: 999;
}

If anyone has insights on solving this issue, your help would be greatly appreciated. Thank you in advance!

Answer №1

To achieve this, you can simply insert an <img> tag into your code. While it may not be the most elegant method or the recommended approach, many websites that utilize materializecss have successfully implemented this technique.

For instance, take a look at the eyerys website. By examining the source code, you'll notice that there is an <img> element right after the initial <li> tag.

More information about this workaround can be found here.

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

Exploring the transition from JavaScript to jQuery

Currently, I have set up an ajax request in combination with JavaScript to fetch data from an external file. The code looks like this: const ajaxRequest = new XMLHttpRequest(); const handleResponse = function() { if (ajaxRequest.readyState === 4) { ...

retrieve the list of css stylesheets connected to a webpage

Currently, I am running some tests on Firefox's Error Console. My main focus is on identifying and rectifying errors in the stylesheets. For regression testing purposes, I need to compile a list of all HTML pages that are connected to these stylesheet ...

Adjust the styling of CSS classes within an ExtJS application

I've been trying to customize the appearance of my calendar panel using extjs. In my EHR application, I have implemented the extjs calendarpanel and datepicker similar to the setup showcased in this link: When a date is selected from the datepicker a ...

Freezing the website by setting async to false

I've been having issues with my website freezing when using async set to false. I need confirmation before executing the script. $.ajax({ type: "POST", url: url, data: form.serialize(), async: false, success: function(data) { ...

The presentation of the Google graph with dynamically changing data appears to be displaying inaccurately

I am looking to incorporate a graph displaying sales and purchase data on my webpage. Users should be able to select from categories like Purchase, Sales, or Production. I have separate tables for Purchase (AccPurchase) and Sales (AccSales), with productio ...

Filtering elements using two dropdown lists

In my list, each li element has data-name and data-body attributes. I want to display only the li elements that match the selected values. The first select option is for selecting the car name, while the second select option is for selecting the car body. ...

Adjusting the dimensions of the image carousel

Here is my code for an Image carousel: <div class="container"> <div class="row"> <div class="col-md-12 col-md-offset-0"> <div id="imageCarousel" class="carousel slide" data-interval="4000" data ...

What is the best way to include a form within every row of an HTML datatables structure?

I have a regular table that is populated with data fetched via Ajax, and it appears like this: Ajax <script> $(document).ready(function() { $('#mytable').DataTable( { "ajax": "myurl", "dataType": 'json', ...

It appears that the use of "window.location" is causing the ajax post

I'm facing an issue with sending data to PHP using AJAX and redirecting to the PHP file. It seems that when I redirect to the PHP file, the data sent through AJAX is not being received. My goal is to have a button click trigger the sending of data to ...

Enigmatic blank space found lurking beneath the image tag

Recently, I made a change to the header image on my website. Previously, it was set using <div style="background-image... width=1980 height=350> and now I switched to <img src="... style="width:100%;"> This adjustment successfully scaled do ...

What could be causing the JQuery date picker to fail to load on the initial ng-click event?

I am encountering an issue with a JQuery UI date picker that is loaded through ng-click using the code below: Input: <input type="text" id="datepicker" autocomplete="off" ng-model="selectedDate" ng-click="showDatepicker()" placeholder="(Click to sele ...

Unlock hidden content with a single click using jQuery's click event

I have a question that seems simple, but I can't quite get the syntax right. My issue is with a group of stacked images. When I click on an image, I want it to move to the front and display the correct description above it. Currently, clicking on the ...

Updating a Django div with JQuery and AJAX

Looking for a way to refresh a specific part of my page using AJAX and JQuery in Django. How can I ensure that only the div is updated, rather than the entire page? // Code snippet from my template var tag_cloud_floor = function(floor) { $.ajax({ ...

Attempting to recreate the dynamic banner featured in the video

Looking to replicate a setup similar to what was demonstrated in the video. I have two div blocks - one with a random image and the other with a video, and I want them to be as flexible and identical as possible to the video layout. How should I go about a ...

Utilizing Bootstrap, the layout structure consists of 4 columns for desktop, 3 columns for small laptops, 2 columns for tablets, and

I need assistance with setting up responsive columns in my HTML code using Bootstrap. Specifically, I want 4 columns per row on desktop, 3 columns per row on tablet, and 2 columns per row on mobile devices. Despite searching on Stack Overflow, I couldn&apo ...

Prevent submitting a form multiple times with jQuery Validate - ensuring successful submission only once

I've been working on updating my Email Contact form with the jQuery Validate Plugin and AJAX within the submitHandler. It initially worked, but I'm running into an issue where it only works once. Upon trying to submit the form again, I stop recei ...

Unable to set DIV width to 100% and show a scrollbar

I am facing an issue with the width of a DIV element on my webpage. Despite setting it to 100% width, it only takes up the visible window's width and not the full page width, especially when a horizontal scroll bar is displayed. Below is the HTML cod ...

Browser refusing to acknowledge jQuery/JavaScript (bootstrap)

Here is where I include the necessary jQuery libraries and my custom jQuery code: <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src= ...

How can I use CSS in Next.js to style a child element when its parent is being hovered over?

Here is the CSS code that specifically targets the child element "#overlay" when its parent, ".collection", is being hovered over: .collection { position: relative; overflow: hidden; } .collection:hover #overlay { position: absolute; opa ...

Sending a Php request using AJAX and receiving JSON values

Trying to retrieve values from PHP using AJAX Post. I've researched and found that JSON dataType should be used, but encountering an error: "SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 72 of the JSON d ...