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

What is causing the unexpected impact of the "Product Quick View" JavaScript plugin on divs that are not being activated by user interaction?

As a newcomer to web design, I have implemented the "Product-Quick-View" plugin from CodyHouse on my website. Upon clicking the DEMO button and inspecting the code, you will find the following: <body> <header> <h1>Product Q ...

SignalR's postback interrupts the functionality of jQuery actions

On my screen, I have a widget that updates data and changes its class based on server-side interactions. It also responds to mouse clicks. To notify multiple clients of updates simultaneously, I'm using SignalR. The problem arises when I wrap everythi ...

jQuery Live allows for the execution of functions multiple times

When utilizing jQuery's 'live' function in dynamic pages where content is loaded via Ajax, I have encountered an issue where button events detected with 'live' are being duplicated. Whenever I access the page containing these butto ...

Guide to invoking a jQuery function by clicking on each link tab

Below is a snippet of jQuery code that I am working with: <script> var init = function() { // Resize the canvases) for (i = 1; i <= 9; i++) { var s = "snowfall" + i var canvas = document.getElementById( ...

Creating a display of divs that flow from left to right in each row, and then stacking the rows from bottom to top using CSS and jQuery

My current dilemma involves a collection of divs that must be displayed in a specific order, but with a rather intricate layout. Essentially, this is the structure of my HTML: <div> <div class="box">1 (first in list)</div> <di ...

DataTables custom filter fails to load complete dataset

My question pertains to DataTables. I have 2 custom filters that are very similar, but one is working while the other is not. Let's take a closer look: The working filter: $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ) { ...

Calculating the total sum of values using a dropdown list as a filter with J

I have successfully implemented a dropdown filter in my jQuery datatable to filter data. However, I am now looking to calculate the sum of all values in the filtered table each time a user selects a value from the dropdown list. How can I achieve this? My ...

When using Cordova on Android, the getResponseHeader("Set-Cookie") function will only return the last cookie and not the entire list of cookies

When working with an Android platform in a Cordova project, the function getResponseHeader("Set-Cookie") only retrieves the last cookie from the response, unlike in the iOS platform where it retrieves all cookies. $.ajax({ type: "POST", cache:false, url: ...

Elevate with Ease: Tailwind's Height Transition

I've been attempting to implement a transition effect using TailwindCSS, but I haven't found an updated version with the latest features. Here's the code snippet: <div id="fadeInElement" className={visible ? " w-2/3 px-5 t ...

Text in gray overlaying image background

I am attempting to design a layout that resembles the following: Although I can create the letter "A" using svg or clip-path, my challenge lies in maintaining the background inside the "A" aligned with the body background. Essentially, I want the backgrou ...

Creating a responsive design with dynamic width using HTML and CSS to handle overflow situations

Struggling to figure out how to achieve this in html, I would like the solution to be limited to just html + css. Javascript/jquery is being utilized on the site, yet I don't want my design to rely on javascript. Section A contains a list of variable ...

What is the process for triggering events when the previous and next buttons are clicked?

Within the jQuery fullcalendar, there are previous and next buttons. Is there a way to trigger specific events when these buttons are clicked? ...

Tips for personalizing Bootstrap columns using identical class names?

Is there a way to customize the background color of each individual .col-5 within the same row while using Bootstrap and a custom CSS file? Changing the styles for one column seems to affect all columns with the same class name. Edit: I'm looking f ...

Having trouble with changing the selected value in JQuery?

I'm attempting to use jQuery to set the select option, but I'm encountering an issue. It is setting the value properly, but the text is not being updated. I've experimented with .prop('selected',true), .attr('selected',t ...

When I click on any input field, button, or other controls on a webpage, the page automatically zoom

I am currently trying to troubleshoot an issue with a bootstrap theme. It seems to be working perfectly on all browsers except for ios safari browsers. Whenever I click on an input field or button, the page suddenly zooms in. It's quite frustrating. ...

Unable to understand the reason behind why the button is not being displayed

I'm having trouble with my quiz app. I have a button to submit answers and move on to the next question, but whenever I try to place it within the div that contains the quiz, the button disappears. Can someone please help me figure out what's wro ...

Dynamic Interactive Content with AJAX

Imagine if all the forms in your application followed this structure: <div id="result_messages"></div> <form action="/action"> <!-- all the form --> </form> Here's an example of what a submit button for this form might ...

What is the best way to switch between components when clicking on them? (The component displayed should update to the most recently clicked one

I am facing a challenge in rendering different components based on the navbar text that is clicked. Each onclick event should trigger the display of a specific component, replacing the current one. I have 5 elements with onclick events and would like to re ...

Creating a canvas with multiple label introductions can be achieved by following these

I am looking to group labels and sublabels on the x-axis of a canvas component. Currently, I only have sublabels like: RTI_0, RTI_1... I would like to add labels to these sublabels like: RTI = {RTI_0,RTI_1,RTI_2] BB = {BB_0, BB_1,BB_2,BB_3] <div cla ...

Can anyone suggest a solution to troubleshoot this issue with CSS Flexbox and absolute positioning?

I'm currently developing a React application featuring flex container cards (referred to as .FilmCard with movie poster backgrounds) within another flex container with flex-wrap. Each card has an item positioned absolutely (an FontAwesome arrow icon). ...