用于 jQuery 移动 (Android) 的日期选择器 [英] Datepicker for jQuery mobile (Android)

查看:22
本文介绍了用于 jQuery 移动 (Android) 的日期选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我知道之前有人问过这个问题,但哪个日期选择器最适合 jQuery Mobile(适用于 Android?)

Okay, I know this question has been asked before, but which date picker is best for jQuery mobile (for Android?)

日期框http://dev.jtsage.com/jQM-DateBox2/

Mobiscrollhttp://mobiscroll.com/

Mobi Pickhttp://mobipick.sustainablepace.net/demo.html

Datebox 和 Mobiscroll 看起来更成熟,但 mobi pick 对我来说感觉更快.

Datebox and Mobiscroll look more mature, but mobi pick feels faster to me.

我还听说有些手机 (Android) 无法使用 mobiscroll?

Also I heard there were certain phones (Android) where mobiscroll does not work?

推荐答案

根据我的经验,您应该在 Mobi Pick 和 Mobiscroll 之间进行选择.

From my experience you should choose between Mobi Pick and Mobiscroll.

我在我之前的安卓手机(galaxy S2)上发现了一些 Datebox 渲染问题,除此之外,Datebox 接近 Mobi Pick(性能虎钳 + 配置潜力).Datebox 和 Mobi Pick 的主要区别在于最终设计.

I found some Datebox rendering problems on my previous android phone (galaxy S2), other then that Datebox is close to Mobi Pick (performance vise + configuration potential). Main difference between Datebox and Mobi Pick is final design.

工作 jsFiddle 示例:http://jsfiddle.net/Gajotres/ktbcP/

Working jsFiddle example: http://jsfiddle.net/Gajotres/ktbcP/

<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "datebox", "useNewStyle":true}'/>

Mobiscroll

Mobiscroll 有更多选项和皮肤.它可以更好地集成到 jQM 中,并且具有更好的响应式 UI,不幸的是它在 2.X android 手机上有性能问题(iPhone 设备没有问题).

Mobiscroll

Mobiscroll has much more options and skins. It can be much better integrated into jQM and it has much better responsive UI, unfortunately it has performance problems on 2.X android phones (no problem with iPhone devices).

工作 jsFiddle 示例:http://jsfiddle.net/Gajotres/WDjfR/

Working jsFiddle example: http://jsfiddle.net/Gajotres/WDjfR/

$(document).on('pagebeforeshow', '#index', function(){       
    $('#demo').mobiscroll().date({
        invalid: { daysOfWeek: [0, 6], daysOfMonth: ['5/1', '12/24', '12/25'] },
        theme: 'android-ics',
        display: 'inline',
        mode: 'scroller',
        dateOrder: 'dd mm yy',
        dateFormat : "dd-mm-yy"
    });  
});

Mobipick

如果您对其 UI 外观感到满意,我会选择 Mobi Pick 而不是 Mobiscroll.如果您不使用 Mobiscroll.

Mobipick

I would pick Mobi Pick over Mobiscroll in case you are satisfied with its UI look. If you are not use Mobiscroll instead.

工作 jsFiddle 示例:http://jsfiddle.net/Gajotres/zyVjE/

Working jsFiddle example: http://jsfiddle.net/Gajotres/zyVjE/

$(document).on('pagebeforeshow', '#index', function(){       
    $('#demo').mobipick({
        dateFormat: "MM-dd-yyyy"
    });
});

更多信息

可以在此处找到详细概述和示例a>.

More info

Detailed overview and examples can be found here.

这篇关于用于 jQuery 移动 (Android) 的日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆