在android / phonegap项目上渲染iscroll

时间:2013-06-16 13:40:46

标签: android iscroll

有没有人知道任何使用iscroll的Android应用程序。我想在我的设备上测试它。原因是我当前的phonegap / android项目不适用于iscroll4 ....

我稍后会发布相同的详细信息....但只是想看看iscroll atall是否适用于android ...我有疑虑......

尝试了调用iscroll的所有方法,但根本不起作用..

这是requirejs的代码:

define(['jquery','domready',
       function($,domReady){
       var menu_iscroll;

       function loaded() {
               alert("inside loaded for iscroll:dom under hmenu is");   
           alert($('#hmenu').html());
           if ($('#hmenu').length){
           alert('setting iscroll');
           menu_iscroll = new iScroll('hmenu');}
       };

       document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

       domReady(function() {
           alert("entered domready for creating iscroll");  
               loaded();
       });

       return menu_iscroll;
       });

这是main.js的代码:

require.config({
    paths:{ 
    jquery:'vendor/jquery/jquery.min',
    'jquery.mobile':'vendor/jquery.mobile-1.3.1.min',
    'jquery.mobile-config':'jqm-config',
    underscore:'vendor/underscore/underscore-min',
    backbone:'vendor/backbone/backbone-min',
    handlebars:'vendor/handlebars/handlebars',
    text:'vendor/text/text',
    bootstrap:'vendor/bootstrap/js/bootstrap.min',
    iscroll:'vendor/iscroll/dist/iscroll-min',
    domready:'vendor/domReady'
    },

    shim: {
        'backbone': {
            //These script dependencies should be loaded before loading backbone.js
            deps: ['jquery','underscore'],
            //Once loaded, use the global 'Backbone' as the module value.
            exports: 'Backbone'
        },

        'underscore': {
            exports: '_'
        },

    'handlebars' : {
            exports : "Handlebars"
        },

    'iscroll' : {
            exports : "iScroll"
        },


    'jquery.mobile-config': {
            deps: ['jquery']
    },  

    'jquery-mobile': {
        deps:['jquery','jquery.mobile-config'],
    },

    },

    waitSeconds:10,
});


require(['jquery','views/menuscroll','index'],function($,scrollView){         
    new scrollView;  

});

和内部scrollview:

define(['jquery','domready','iscroll','test'],
       function($,domReady,iScroll,testView){
       new testView; //this is where all the rendering of the DOM occurs...
       var menu_iscroll;

       function loaded() {
               alert("inside loaded for iscroll:dom under hmenu is");   
           alert($('#hmenu').html());
           if ($('#hmenu').length){
           alert('setting iscroll');
           menu_iscroll = new iScroll('hmenu');}
       };

       document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

       domReady(function() {
           alert("entered domready for creating iscroll");  
               loaded();
       });

       return menu_iscroll;
       });

我现在非常有信心在android平台上使用phonegap / iscroll / requirejs进行调试后,很多市场上出售的iscroll模块无法在android上呈现....它根本无效......

0 个答案:

没有答案