I cant get iScroll to work when horizontal

1,256 views
Skip to first unread message

antoine...@gmail.com

unread,
Jun 1, 2011, 10:23:36 AM6/1/11
to isc...@googlegroups.com
Hi.

I have been using iScroll for the past few days and I like it so far. However, I find myself unable to make it work when the content is supposed to scroll horizontally.

Here is a test page I built : http://www.lesforges.org/tmp/iscroll/broken.html
I tried it on an iPad 2 and I couldnt get things to scroll horizontally, did I do something wrong ?

Thanks for reading.

Brian Fling

unread,
Jun 1, 2011, 7:08:11 PM6/1/11
to isc...@googlegroups.com
horizontal scrolling is all about making sure you have the right widths on the right containers. If you are familiar with carousels it works in a pretty similar fashion. My advice is start with the horizontal scrolling example code provided in the iScroll build and customize to suit. 

Jordan Dobson

unread,
Jun 1, 2011, 11:33:06 PM6/1/11
to iScroll
Agreed. Primarily, make sure your width on the scrolling wrapper is
set AND the width of its child element has a GREATER width than it's
parent. That's typically where I run into problems.

You don't typically have this issue when working vertically since text
will automatically increase the height of an element. That of course
doesn't happen horizontally.

Brian Fling

unread,
Jun 2, 2011, 12:01:36 PM6/2/11
to isc...@googlegroups.com
Posted this in another post, but I'll post it here too:

-> a "fauxport" that defines the viewable area. basically like a viewport (e.g. 320px x 480px). 
     it will clip the container to whatever you define the fauxport to be
---> a container that defines the total horizontal width of all the elements you wish to scroll 
      e.g. 4x pages @ 320px means your container is 1280px wide
-----> the items or "pages" you wish to scroll, with a defined width. 
         e.g. to fill the fauxport make each page 320px x 480px. 

Hopefully that explains it.

-Brian

antoine...@gmail.com

unread,
Jun 6, 2011, 5:12:39 AM6/6/11
to isc...@googlegroups.com
You were correct, I had not set my container's width. Thanks for helping.
Reply all
Reply to author
Forward
0 new messages