YUI3 ScrollView Touch - module to use CSS scrollviews for touch devices

How to use it

<script src=""></script>
YUI().use("gallery-scrollview-touch", function (Y)
    var scrollview = new Y.ScrollViewTouch({
        srcNode: node,
        axis: 'y',
        width: 100

Why this module ?

Recent mobile browsers allow us, to make scrolls on DOM element (overflow:scroll). W3C is still working on this subject (, so this feature is not implemented in a lot of browsers. Only Internet Explorer 10 has it (ms-touch-action), but webkit has implemented a few months ago, a similar feature named ‘webkit-overflow-scrolling’. Using this two features, we can cover a important percentage of touch devices.

This module is still in progress, and I will appreciate your feedback and your ideas on it.


  • Scrolls are faster and smoother, because browser render it directly without using JavaScript engine.
  • Scrolls respect native UX behavior : on iOs, the scroll ‘bounce’ when ending, whereas on Android, there isn’t.

Browsers compatibilities

This module use some new CSS3 features (touch-action and overflow Scrolling) to render scrollviews. For browsers that can render it, we use the ‘classical’ scrollviews of YUI3 (made with Javascript and translate feature).

CSS Scrolls is available on :

  • Android Browser 3+
  • Safari 5.1+ (iOs 5+)
  • Chrome 12+
  • Internet Explorer 10+


  • srcNode (String) : The source node to apply the scrollview

  • axis (x y) : The axis of the scrollview
  • width (int): The width of the scrollview to display

  • height (int): The height of the scrollview to display

You can also specify the arguments of the Y.Scrollview module (duration, easing, bounce, etc…). They will be ignored for CSS rendering, but for not-capable devices, fallback scrollviews will be rendered with this arguments.

Make a Donation