We have built an iPhone style date picker. It is functional at the moment in everything except IE. What I do not know how to do is find the tittle attribute of which ever value is in the centre.
Here is a fiddle : http://jsfiddle.net/XHPYF/1/
Any ideas,
Marvellous
Here’s a way – http://jsfiddle.net/pxfunc/XHPYF/7/
class='selected'topoffset value for the current selected element and save it to a variable for step 3onScrollEndevent (in your iScroll plugin) to track changes by:1) Clearing the current element marked as
selected2) Iterating the list items to determine where the
topoffset is equal to the initially selected item and mark it as theselecteditemUPDATE (the original solution works in Webkit browsers but Firefox works a bit different):
you’ll need to parse the data from either
or
In both cases the
-32pxwould need to be parsed out and used to determine the selected list item.Here’s a solution for Firefox
http://jsfiddle.net/XHPYF/13/
now you just need to figure out how to make it work in IE 🙂
this is definitely an experimental user control, browser updates could potentially break it and useragent detection for determining which way to get the selected item is a pretty big no-no in general. Still, the iPhone look and functionality is fun and cool.