Search code examples
jquery-mobilemobile-websitemobile-webkit

How to use joehewitt scrollability?


Can anyone help me out in implementing joehewitt's scrollability plugin.(https://github.com/joehewitt/scrollability.git) I am trying to develop a mobile web app!

Thanks in advance!


Solution

  • Right so,

    1)Include the javascript file and the css file (its in the static folder)

    2) Head to http://scrollability.com/ and following the structure create the two divs:

    <div id="overflow">
      <div id="scrollysection">
      </div>
    </div>
    

    With the following CSS

    #overflow
        overflow:hidden
        position:absolute
        top:0px
        left:0px
        width:100%
        height:100%
    
    #scrollysection
    position:absolute
    top:0px
    left:0px
    

    3)Then you need to apply the fix here: https://github.com/joehewitt/scrollability/issues/29

    To get the code running just comment out or remove all of the exports stuff (lines 77-84). Then on line 94 where require is mentioned, just pull the two lines of code out of that ready function and comment the ready function out.

    Thats what I did and it worked.