I’d like to mimick iPhone main screen in JavaScript on Safari / Chrome / Firefox.
By mimicking I mean:
– Having a couple of pages
– Switching between the pages by clicking & dragging / swiping with my mouse
– Having those dots from the bottom iPhone main screen displaying which page it is
The closest to what I want is:
http://jquery.hinablue.me/jqiphoneslide/
But the sliding doesn’t work nearly as good as in iPhone (i have to slide first, and the animation appears after i release the mouse button), and there are no dots at the bottom.
I solved the problem by using jQuery & jquery.slide-0.4.3.js .
jQuery Slide automatically slides between each page, so I had to add a mouse event (onMouseDrag) that stops automatic slide & reacts to user. It works very well.
This is what I added to jSlide
And also, to prevent text selection when dragging with mouse I added before jSlide class declaration:
I’m not sure if all the code is necessary… most probably you’ll still need to tweak it after pasting into jquery.slide, but it should get you started..