Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/01/2014, 11:32
Avatar de sergi_multimedia
sergi_multimedia
 
Fecha de Ingreso: noviembre-2010
Mensajes: 213
Antigüedad: 14 años, 3 meses
Puntos: 4
Exclamación Respuesta: No funciona link en pantalla táctil

Muchas gracias por tu aportación pzin, estabas en lo cierto, dentro del archivo JS había la siguiente línea de código que he lo he puesto como comentario:

Código Javascript:
Ver original
  1. $this.bind('touchstart', touchstart);

Al comentar la línia de código los links funcionan perfectamente, pero claro, ahora como aspecto negativo es que la navegación simplemente se puede hacer a través de la los puntos de paginación que hay a la derecha de la web.

Creo que no será necesario copiar todo el código del script, a ver si con lo que comparto es suficiente.

Código Javascript:
Ver original
  1. $.fn.swipeEvents = function() {
  2.  return this.each(function() {
  3.   var startX,
  4.   startY,
  5.   $this = $(this);
  6.   // ESTO ESTÁ COMENTADO $this.bind('touchstart', touchstart);
  7.  
  8.   function touchstart(event) {
  9.    var touches = event.originalEvent.touches;
  10.    if (touches && touches.length) {
  11.     startX = touches[0].pageX;
  12.     startY = touches[0].pageY;
  13.     $this.bind('touchmove', touchmove);
  14.    }
  15.    event.preventDefault();
  16.   }
  17.  
  18.   function touchmove(event) {
  19.    var touches = event.originalEvent.touches;
  20.    if (touches && touches.length) {
  21.     var deltaX = startX - touches[0].pageX;
  22.     var deltaY = startY - touches[0].pageY;
  23.     if (deltaX >= 50) { $this.trigger("swipeLeft"); }
  24.     if (deltaX <= -50) { $this.trigger("swipeRight"); }
  25.     if (deltaY >= 50) { $this.trigger("swipeUp"); }
  26.     if (deltaY <= -50) { $this.trigger("swipeDown"); }
  27.     if (Math.abs(deltaX) >= 50 || Math.abs(deltaY) >= 50) {$this.unbind('touchmove', touchmove);}
  28.   }
  29.     event.preventDefault();
  30.    }
  31.   });
  32. };

¿Alguna solución para que funcione el scroll también en pantallas táctiles?

Saludos y gracias de antemano.