Created
January 10, 2012 13:57
-
-
Save lbj96347/1589209 to your computer and use it in GitHub Desktop.
iscoll simple setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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