Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
mover texto con scroll

Así que estoy tratando de convertir el tutorial de algunos chicos de una animación que se mueve cuando el mouse se mueve para moverse cuando se desplaza hacia abajo. ahora se está moviendo, pero solo cuando muevo el mouse y me desplazo al mismo tiempo.

Estoy buscando un método que mueva las palabras cuando solo se desplaza

 <section id="bbbb"> <div class="text"> <h2 style="--i:0.5"><span> because boring is bad for business</span> </h2></div> </section> const position = document.documentElement; position.addEventListener('mousewheel', e => { position.style.setProperty('--x', e.clientX + 'px')

})

 .text h2 { position: relative; width: 100%; font-size: 6.5em; color: rgb(255, 255, 255); line-height: 1em; white-space: nowrap; text-shadow: calc(var(--x)) 100px 0 rgba(255, 255,255,0.2); transform: translateX(calc(0% - var(--x)*var(--i))); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

tu javascript será así

 const element = document.querySelector("#container"); element.addEventListener('wheel', (event) => { event.preventDefault(); element.scrollBy({ left: event.deltaY < 0 ? -30 : 30, }); });
 #container { display: flex; overflow-x: scroll; overflow-y:hidden; max-width: 50rem; margin: 0 auto; } .text h2 { position: relative; width: 100%; font-size: 6.5em; color: black; line-height: 1em; white-space: nowrap; text-shadow: calc(var(--x)) 100px 0 rgba(255, 255,255,0.2); transform: translateX(calc(0% - var(--x)*var(--i))); }
 <div id="container"> <section id="bbbb"> <div class="text"> <h2 style="--i:0.5"><span> because boring is bad for business</span> </h2></div> </section> </div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!