Ahrjay, are you preloading the images?

On Jul 6, 4:42 am, Ahrjay <[EMAIL PROTECTED]> wrote:
> Ok hopefully someone can help me with this question, thanks to Luke I
> can determine which direction the user is going. What I have happening
> is based on which direction the user is swiping, I swap a sequential
> number of images either positively or negatively. The thing is it is
> very choppy in that it may do 1 or 2 images then stop swapping them
> until I release my finger then it will skip a whole bunch of images
> and go to the last counted.
>
> The script just swaps out the src of the image on screen with a array
> of all images:
>
> function touchMove(event)
> {
>      currentX = event.touches[0].pageX;
>      pixelsMovedX = currentX - startX;
>      console.log("current X: " + currentX + " Amount of pixels moved:
> " + pixelsMovedX);
>
>      if(pixelsMovedX > 0)
>      {
>         counter++;
>      } else {
>         counter--;
>      }
>      if(counter > 23)
>      {
>         counter = 0;
>      }
>      if(counter == -1)
>      {
>         counter = 23;
>      }
>      document.getElementById(imgName).src = images[counter];
>      console.log(counter);
>
> }
>
> Is there a way to smoothly swap through the images so it seems
> seamless?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to