Skip to content

Instantly share code, notes, and snippets.

@lbj96347
Created January 10, 2012 13:57
Show Gist options
  • Save lbj96347/1589209 to your computer and use it in GitHub Desktop.
Save lbj96347/1589209 to your computer and use it in GitHub Desktop.
iscoll simple setup
If you have only text and all images have fixed dimensions (ie: explicit width/height) you may use the DOMContentLoaded event.
Besides: header/footer/wrapper/scroller all these elements should be position-absolute.
In the document HEAD add:
<style>
#wrapper {
position:absolute; z-index:1;
top:45px; bottom:48px; left:0;
width:100%;
background:#aaa;
overflow:auto;
}
#scroller {
position:absolute; z-index:1;
/* -webkit-touch-callout:none;*/
-webkit-tap-highlight-color:rgba(0,0,0,0);
width:100%;
padding:0;
}
</style>
<script type="application/javascript" src="iscroll.js"></script>
<script type="text/javascript">
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper');
}
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment