我的Jquery代码在桌面浏览器中运行良好但在移动浏览器中无法运行

时间:2017-09-20 09:55:08

标签: javascript jquery html materialize

我有一个页面,其中我使用jquery隐藏show和模式框打开关闭。它运行良好的桌面浏览器,但不能在移动浏览器中工作。即使我在浏览器的响应屏幕中打开它也工作正常。请帮我解决这个问题,并且控制台中没有显示错误。这是我的jquery代码。提前致谢。

    $(document).ready(function(){
    $(".button-collapse").sideNav();
});
$(document).ready(function(){
    $('ul.tabs').tabs({
      swipeable : true,
      responsiveThreshold : 1920
    });
  });
   $(document).ready(function() {
        $("#form").hide();
        $(".save-form").hide();
        $(".edit-form").click(function() {
            $("#detail").hide(200);
            $("#form").show(200);
            $(".edit-form").hide();
            $(".save-form").show();
        });
        $(".save-form").click(function() {
            $("#detail").show(200);
            $("#form").hide(200);
            $(".edit-form").show();
            $(".save-form").hide();
        });
        $('.datepicker').pickadate({
            selectMonths: true, // Creates a dropdown to control month
            selectYears: 200, // Creates a dropdown of 15 years to control year,
            today: 'Today',
            clear: 'Clear',
            close: 'Ok',
            closeOnSelect: false // Close upon selecting a date,
        });
        $('.start-college').pickadate({
            selectMonths: true, // Creates a dropdown to control month
            selectYears: 100, // Creates a dropdown of 15 years to control year,
            today: 'Today',
            clear: 'Clear',
            close: 'Ok',
            closeOnSelect: true // Close upon selecting a date,
        });
        $('.end-college').pickadate({
            selectMonths: true, // Creates a dropdown to control month
            selectYears: 100, // Creates a dropdown of 15 years to control year,
            today: 'Today',
            clear: 'Clear',
            close: 'Ok',
            closeOnSelect: true // Close upon selecting a date,
        });
        $('input.gender').autocomplete({
            data: {
                "Male": null,
                "Female": null
            },
            limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
            onAutocomplete: function(val) {
                // Callback function when value is autcompleted.
            },
            minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
        });
        $('input.college').autocomplete({
            data: {
                "PSIT": null,
                "PSIT COE": null,
                "KIT": null
            },
            limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
            onAutocomplete: function(val) {
                // Callback function when value is autcompleted.
            },
            minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
        });
        $('input.city').autocomplete({
            data: {
                "Kanpur": null,
                "Jaipur": null
            },
            limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
            onAutocomplete: function(val) {
                // Callback function when value is autcompleted.
            },
            minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
        });
        $('input.field').autocomplete({
            data: {
                "Information Technology": null,
                "Computer Science": null
            },
            limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
            onAutocomplete: function(val) {
                // Callback function when value is autcompleted.
            },
            minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
        });
        $('input.degree').autocomplete({
            data: {
                "B.TECH": null,
                "BSc": null,
                "B.COM": null
            },
            limit: 20, // The max amount of results that can be shown at once. Default: Infinity.
            onAutocomplete: function(val) {
                // Callback function when value is autcompleted.
            },
            minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
        });
        $('#textarea1').val('New Text');
        $('#textarea1').trigger('autoresize');




    });
    $(document).ready(function() {
        // the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
        $('.modal').modal();
    });

0 个答案:

没有答案