Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
Slide to edit Div Height Ipad browser

I want to when touching the pink line, the user could slide up and down to change its position, this works perfectly on a desktop browser, but struggle when using an Ipad browser

hier is my code for sliding and changing height :

const handler = document.querySelector('.handler');

handler.addEventListener('touchstart', (e) =>  {
  // If mousedown event is fired from .handler, toggle flag to true

  this.isHandlerDragging = true;
  // @ts-ignore

  this.y = e.view.innerHeight;
  // @ts-ignore
  console.log(e.touches[0].clientY);
});
document.addEventListener('touchmove', (ev) =>  {
 // console.log(ev);
  // If mousedown event is fired from .handler, toggle flag to true
  if (this.isHandlerDragging){

    console.log('ev.touches[0].clientY = ' + ev.touches[0].clientY)
    console.log('this.y = ' + this.y)
    console.log('this.dy = ' + this.dy)


    // @ts-ignore
    this.dy = ev.touches[0].clientY - this.y;
    // @ts-ignore
    this.y = ev.touches[0].clientY;
    this.scrollSCNoStaff -= this.dy;

    this.heigthScrollNS += (this.dy);
    this.scrollHeigth += (this.dy / 2);

  }
});

document.addEventListener('touchend', (e) => {
  // Turn off dragging flag when user mouse is up
  this.isHandlerDragging = false;
});

When I just try to move the mouse after touching the pink bar it goes up or down very quick

enter image description here After touching and moving it just disappear (the div height is superior to the screen height) enter image description here

Please help

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda