1

動的に div を作成し、iscroll js を使用してスクロール バーを追加しようとしました。

しかし、私のアプリケーションでエラーが発生しました。

誰でも私を案内できますか?

// 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

1 に答える 1

4

以下の div をコードに追加して確認します。

<div style="width:100%; float:left;  overflow-x:scroll;  padding-top:260px;>
  </div>
于 2012-06-08T09:24:27.837 に答える