我已閱讀了一堆論壇,但沒有一個解決了我的問題。我敢肯定,它的小東西我失蹤iScroll不滾動的內容,只是彈跳回到頂部
這裏是iscroll初始化:
// make PI scroll
piScroll2 = new iScroll('pi_scroll2');
這裏是我的CSS:
.pi_panel.large .content{
position: absolute;
width: 963px;
height: 616px;
top: 65px;
left:30px;
background:none;
/*background:url(../images/ISI_body.png) repeat-y;*/
overflow:scroll;
-webkit-border-radius: 0px;
}
#FullPiWrapper
{
position:relative;
z-index: 1;
overflow:hidden;
top: 60px;
width:980px;
height: 610px;
}
.pi_panel .pi_box{
padding: 0px;
margin: 20px 0px;
}
這是我的html:
<!-- BEGIN: PI PANEL LARGE -->
<div class="pi_panel large">
<div class="topBarPiFull">
<div class="title">Full Prescribing Information</div>
<div class="close_button_fullpi">Close</div>
<div class="annotated_pi_button">Annotated PI</div>
</div>
<!-- <div class="popContent"></div>-->
<div class="content" id="FullPiWrapper">
<div id="pi_scroll2">
<div class="pi_box" >
<img src="_globals/images/PI/pi_1.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_2.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_3.png"/>
<img src="_globals/images/PI/pagebreak.png"/>
<img src="_globals/images/PI/pi_4.png"/>
<img src="_globals/images/PI/pagebreak.png"/>
<img src="_globals/images/PI/pi_5.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_6.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_7.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_8.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_9.png"/>
<img src="_globals/images/PI/pagebreak.png" />
<img src="_globals/images/PI/pi_10.png"/>
</div>
</div>
</div>
</div>
<!-- END: PI PANEL LARGE -->
加我1。要添加到您的答案,iscroll的容器元素必須在iscroll被初始化之前可見。我剛剛與ipad webapp上的iscroll作鬥爭,所有視圖都是動態顯示的。 –
**另請參閱此處的問題與iscroll 5的答案:http://stackoverflow.com/questions/25962095/iscroll-5-not-working-when-2nd-page-should-be-scrollable – Mike6679