markbrown4 — 2013-09-14T23:37:30-04:00 — #1
I'm trying to achieve an effect that is present in long lists on iOS.
In the contact app there's a long list of names and there's a sticky letter showing which is the letter you have scrolled to. When you scroll and the letters overlap the previous is pushed out if the way.
Even with scripting I'm finding it difficult to achieve this effect. How would you do it?
Interested in horizontal and vertical solutions.
ralphm — 2013-09-15T00:51:33-04:00 — #2
Which is the contact app? It would be handy to see this in practice.
EDIT: O, I see—you mean in the Contacts section of the Phone app?
paulob — 2013-09-15T08:26:02-04:00 — #3
Do you mean [something like this Mark from [URL="http://css-tricks.com/persistent-headers/"]CSS tricks](http://css-tricks.com/examples/PersistantHeaders/)?
There is also a jquery plugin that might fit the bill.
markbrown4 — 2013-09-16T04:33:54-04:00 — #4
Yeah that's close to the effect. You really have to see it to know what I mean though. In the contacts section of the phone app when you scroll to the letter B, the letter A becomes unfixed an b pushes A out of the way. I believe these solutions would all snap the headers at a switch point.
It's the effect of the two letters pushing each other just before they get fixed in place I am trying to achieve.
paulob — 2013-09-17T12:51:25-04:00 — #5
Here's my attempt at the above assuming I've understood correctly as I don't have an iphone
ralphm — 2013-09-18T01:43:05-04:00 — #6
That's brilliant, Paul. I think you've nailed it.
paulob — 2013-09-18T15:21:39-04:00 — #7
Thanks Ralph - I like a challenge
markbrown4 — 2013-10-15T00:48:51-04:00 — #8
Sorry for the late response, just got back home after 10 weeks in India and Nepal.
Now to see what magic you have conjured up..
markbrown4 — 2013-10-15T01:24:19-04:00 — #9
Should be able to make something work with different events like touch or simple timers if need be.
paulob — 2013-10-15T07:50:35-04:00 — #10
I wondered where you had got to
Hope you had a good time.
paulob — 2013-10-22T18:36:18-04:00 — #11
I just noticed there's a similar demo here but it doesn't seem as smooth as mine and is about a 1000 lines more code.