Reputation: 739
I want to make a horizontal scroller using iScroll but it wont work. I get the attributes on the correct divs but am unable to scroll. Here's the js:
//called on onload
var levelPackScroller;
function init() {
levelPackScroller = new IScroll('#levelButtonPreScroller')
levelPackScroller.refresh()
}
html:
<div id="levelButtonPreScroller">
<div class="levelButtonScroller" id="levelButtonScroller">
//bunch of <divs> go inside here
<div></div>
</div>
</div>
css:
.levelButtonScroller {
width: 2800px;
height: 938px;
}
#levelButtonPreScroller {
position: absolute;
height: 945px;
width: 711px;
overflow: hidden;
left: 55px;
}
help?
Upvotes: 2
Views: 2028
Reputation: 11543
From the iScroll documentation:
By default only vertical scrolling is enabled. If you need to scroll horizontally you have to set scrollX to true. See horizontal demo.
You should add
levelPackScroller = new IScroll('#levelButtonPreScroller', {
scrollX : true
})
Upvotes: 2