Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3974962
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:37:46+00:00 2026-05-20T04:37:46+00:00

I am trying to build a touch/swipe carousel for mobile safari. So far, so

  • 0

I am trying to build a touch/swipe carousel for mobile safari. So far, so good, but I am running into an issue when I try to set the left position of the elements after they’ve been swiped. The left positions are being set correctly in CSS, but they are displayed incorrectly.

Sorry if this is not clear, but it’s a bit difficult to describe.

Please see the problem here (please view on your iOS or Android device).

To reproduce,

  • Touch item 3

  • Swipe to the left, just enough so that Item 1 is off the screen (do not lift your finger off the screen. You should see Item 2, Item 3, Item 4, Item 5, and some of Item 6.

  • Lift your finger off the screen (you will see the items “jump”. Item 3 is now where Item 2 was, Item 4 where Item 3 was, etc)

  • Now, try to swipe to the left again. You will the items “jump” again. Item 2 is back where it was supposed to be.

Basically, what I do is translate the items based on the swiped distance. On touch end, I set the positions of the elements to the translated positions. That’s where it’s breaking.

All my code is in the url above.

Any help would be greatly appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:37:46+00:00Added an answer on May 20, 2026 at 4:37 am

    Got it!

    So my problem was not resetting the transform. I added this line:

    items[i].style.webkitTransform = "translate3d(0px, 0px, 0px)";
    

    to my updatePosition function and all is well!

      function updatePosition(){
        for(var i=0; i<items.length; i++){
          var translatedLeft = getTranslatedPosition(items[i]).left;
          items[i].style.left = translatedLeft + "px";
          items[i].style.webkitTransform = "translate3d(0px, 0px, 0px)";
        }
      }
    

    working demo here: http://dl.dropbox.com/u/10250170/dev/carousel/touch_test.html (view in iPhone simulator or your iOS or Android device)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build Sencha Touch 2 application for production, but get an error.
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm just delving into Objective C and Cocoa Touch and I'm trying to build
I'm trying to build a store with elements from localStorage in my Sencha Touch
I'm trying build a MVC framework, but I'm confused about manage themes. Well... I
I'm trying to build a simple photo crop utility where user can touch and
I am trying to build a web app for Android device using Senahc Touch
(complete re-edit of my previous post) I'm trying to build my first Sencha touch
I'm trying to build a function that compacts the sprintf function, but somehow I
I'm trying to fetch some data from Yahoo's API and Im running into some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.