2012-06-08 3 views
1

동적으로 div를 만들었습니다. iscroll js를 사용하여 스크롤 막대를 추가하려고했습니다.phonegap에 스크롤 바를 추가하는 문제 android

그러나 내 응용 프로그램에서 오류가 발생했습니다.

아무도 나를 안내 할 수 있습니까?

// here to add scroll bar 

function loaded() { 
    myScroll = new iScroll('wrapper', { scrollbarClass: 'myScrollbar' }); 
} 
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); 
document.addEventListener('DOMContentLoaded', loaded, false); 

// here i created a div dynamically 

$results_list = $('<div id="wrapper" class="'+options.resultsClass+'" style="width:92%;height:10%;overflow:auto;position:absolute;"></div>').hide();//here i need to add scroll bar? 
doIscrollRefresh(); 

오류 메시지

TypeError: Result of expression 'that.wrapper' [null] is not an object. at file:///android_asset/www1/iscroll.js:60

답변

4

그것을 코드에서 DIV 아래에 추가하고 확인 :

<div style="width:100%; float:left; overflow-x:scroll; padding-top:260px;> 
    </div> 
관련 문제