Question

I am using jQuery Mobile and iScrollview together, I used iscrollView

The scrolling work fine.

Problem 1:

when I click on a input text/password field, I get an extra box overlapping the whole elements, which has the same content as the input. same problem found in

here no solution

Problem 2:

when navigating to next page, the previous page remains behind new page and when tap the mobile screen the previous page goes off from the device. this is not happening in the webbrowsers. Any suggestions,

code for main.js

 require.config({
    paths: {
        jquery: '../lib/jquery',
        'jquery.mobile-config': 'helper/jqm-config',
        'jquery.mobile': '../lib/jquery.mobile-1.2.1.min',
        underscore: '../lib/underscore-min',
        backbone: '../lib/backbone-min',
        templates: '../templates',
        text: 'helper/text',
        config: 'helper/config',
        'backbone.subroute': '../lib/backbone.subroute',
        'cookie': '../lib/jquery.cookie',
         'maskInput': '../lib/Jquerymaskinput',
        'iscroll': '../lib/iscroll',
        'iscrollview': '../lib/jquery.mobile.iscrollview',
            }
    ,
    shim: {
        'underscore': {
            exports: "_"
        },
        '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'
        },
        'jquery.mobile-config': ['jquery'],
        'jquery.mobile': ['jquery', 'jquery.mobile-config'],
        'backbone.subroute': ['jquery', 'underscore', 'backbone'],
        //'backbone.oauth':['jquery','underscore','backbone'],
        'iscroll': {
            deps: ['jquery.mobile']
        },
        'iscrollview': {
            deps: ['iscroll']
        },
        'config': {
            exports: 'Config'
        }

    }

});
requirejs(['jquery', 'iscroll', 'jquery.mobile', 'iscrollview'], function($, iScroll) {
    var elements = jQuery(document).find(":jqmData(iscroll)");
    elements.iscrollview();
    
});

require([
    'app'

], function(App) {
    App.initialize();
});

for router

define([
    'jquery',
    'underscore',
    'backbone',
    'backbone.subroute'
], function($, _, Backbone) {
    var AppRouter = Backbone.Router.extend({
        routes: {
            // general routes 
            '': 'defaultAction',
            'login':'login',               
            'menu': 'mainMenu',        
           
            // Default
            '*actions': 'defaultAction'       
        }
    });
  
    var initialize = function() {

            $('.back').live('click', function(event) {
                event.preventDefault();
                window.history.back();
                return false;
            });

        var app_router = new AppRouter;       
        app_router.on('route:defaultAction', function(actions) {
            require(['views/home/register'], function(RegisterView) {
                // We have no matching route, lets display the home page 
                console.log('At defaultAction');
            var registerView = new RegisterView();
            registerView.render();
               /// this.changePage(loginView, 'slide');
            });
        });          
         app_router.on('route:login', function(actions) {
            require(['views/home/login'], function(LoginView) {
                // We have no matching route, lets display the home page 
                console.log('At defaultAction');
            var loginView = new LoginView();
            loginView.render();
               /// this.changePage(loginView, 'slide');
            });
        });
        app_router.on('route:mainMenu', function(actions) {
            require(['views/home/menu'], function(MainMenuView) {
                console.log('At mainMenu::router');
            var mainMenuView = new MainMenuView();
            mainMenuView.render();
              //  this.changePage(mainMenuView, 'slide');
    });
        });

        Backbone.history.start();
    };
    return {
        initialize: initialize
    };
});
Était-ce utile?

La solution

I rewrite the codes but, its more or less solved my problem updated the jqm to 1.3 and jquery to 1.9. rewrite all css files. Navigation to next page is fine and at least its working now.

Thanks to Omar who helped me.

gracias mi amigo

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top