My div is not moving when using Framer Motion in React

Asked

Viewed 14 times

-4

It was supposed to be a div down when I scroll the page, but that doesn’t happen. Someone could tell me the possible reasons?

const { scrollYProgress } = useViewportScroll();
const frameTop = useTransform(scrollYProgress, [0.00, 0.082], ['17%', '10.5%']);

    return (

        <motion.div id="container-menu" style={{
            width: '42vh',
            height: '80vh',
            top: frameTop,
            bottom: 0,
            left: 0,
            right: 0,
            marginLeft: '-15vw',
            backgroundColor: '#FFF',
            borderRadius: '0 2h 2vh 0',
            boxShadow: '0px 4px 4px rgb(0, 0, 0, 0.25)',
            position: 'fixed',
            display: 'flex',
            justifyContent: 'space-between',
            cursor: 'default',
            transition: 'all 0.3s'
        }}>
  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.