justin-chu / react-fast-marquee

A lightweight React component that harnesses the power of CSS animations to create silky smooth marquees.
https://react-fast-marquee.com
MIT License
1.16k stars 95 forks source link

img not displaying for first marquee cycle, only for the second cycle #81

Open matrixvivi opened 1 year ago

matrixvivi commented 1 year ago

i have an img element sandwiched between h1 text that do not appear in the first iteration of the marquee, but shows in the second cycle. I don't understand why this is occurring, as the code should be the same/constant for both cycles. I inspected element, and it seems like the imgs that aren't displaying are positioned above the marquee and viewport, making them not visible, but I don't know why they are positioned like such.

screenshots:

code:

<div` className="headline">
                <Marquee pauseOnHover='true' speed={50} className='marquee-ctn'>
                    <img src={Img} className='img-style' />
                    <h1>CHRIS KANG's WEBSITE</h1>
                    <img src={Img} className='img-style' />
                    <h1>CHRIS KANG's PORTFOLIO</h1>
                    <img src={Img} className='img-style' />
                    <h1>CHRIS KANG's WEBSITE</h1>
                    <img src={Img} className='img-style' />
                    <h1>CHRIS KANG's PORTFOLIO</h1>
                </Marquee>
            </div>
.marquee-ctn` {
    height: 56px;
    margin-top: -2px
}

.marquee-ctn h1{
    padding: 0 0.5em 0 0.5em;
}

.img-style {
    height: 40px;
    width: auto;
}
raqibnur commented 11 months ago

Same thing are happening with me also

jdross commented 5 months ago

I am encountering the same issue on mobile only for a marquee of only images. Only the images seen initially load, unless the marquee is tapped

jdross commented 5 months ago

This was due to lazy loading in Next Image. Resolved with eager loading