jQuery Mobile Datepicker 使用
插件引入文件:
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="jquery.mobile-git.css" />
<link rel="stylesheet" href="jquery.mobile.datepicker.css" />
<link rel="stylesheet" href="jquery.mobile.datepicker.theme.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="external/jquery-ui/datepicker.js"></script>
<script src="jquery.mobile-git.js"></script>
<script src="jquery.mobile.datepicker.js"></script>
<!--简体中文-->
<script src="datepicker-zh-CN.js"></script>
<!--隐藏日期控件输入框-->
<style>
.ui-input-text{display:none;}
</style>
js部分:获取选择的日期:
//默认日期格式
var currentDateOjb =$("#datepicker").datepicker();//得到日期对象
currentDate=currentDateObj.val()//日期字符串
alert(currentDate);
//指定日期格式
var date= $("#datepicker").datepicker({ dateFormat: "yy-mm-dd" }).val()
alert(date);
html部分:
<input type="text" id="datepicker" data-inline="true" data-role="date" />
推荐:http://codego.net/77722/
附录:
datepicker-zh-CN.js内容:
/* Chinese initialisation for the jQuery UI date picker plugin. */
/* Written by Cloudream (cloudream@gmail.com). */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "../widgets/datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
}(function( datepicker ) {
datepicker.regional['zh-CN'] = {
closeText: '关闭',
prevText: '<上月',
nextText: '下月>',
currentText: '今天',
monthNames: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
monthNamesShort: ['一月','二月','三月','四月','五月','六月',
'七月','八月','九月','十月','十一月','十二月'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
dayNamesMin: ['日','一','二','三','四','五','六'],
weekHeader: '周',
dateFormat: 'yy-mm-dd',
firstDay: 1,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: '年'};
datepicker.setDefaults(datepicker.regional['zh-CN']);
return datepicker.regional['zh-CN'];
}));
jQuery Mobile Datepicker 使用的更多相关文章
- jquery mobile datepicker
1.http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/ 这个只能用在iOS和PC上,使用<input date,An ...
- jQuery Mobile入门
转:http://www.cnblogs.com/linjiqin/archive/2011/07/17/2108896.html 简介:jQuery Mobile框架可以轻松的帮助我们实现非常好看的 ...
- 解决Jquery mobile点击较长文本body的时候Header和footer会渐入渐出的问题
在做一个Phonegap+Jqm工程的时候,出现了如题的问题,相信很多人都遇到过Jquerymobile点击body时候header和footer会闪烁的显示和隐藏问题,fixed却并不能真 ...
- jquery mobile 问问多多
jquery mobile 问题多多,兼容性太差.android4.1下完全崩溃.以后再也不用jquery mobile了
- jQuery UI Datepicker使用介绍
本博客使用Markdown编辑器编写 在企业级web开发过程中,日历控件和图表控件是使用最多的2中第三方组件.jQuery UI带的Datepicker,日历控件能满足大多数场景开发需要.本文就主要讨 ...
- jquery.mobile手机网页简要
先上最终效果: 最近做了一个用手机浏览器访问的web应用,采用较流行的HTML5,为了提高开发效率节省时间决定采用现有开源框架,免去了自己做设计与兼容性. 一些比较优秀的框架:10大优秀的移动Web应 ...
- jQuery Mobile案例,最近用Moon.Web和Moon.Orm做了一套系统
一.简介 先说说,我们的主题.jQuery Mobile,最近用Moon.Web和Moon.Orm做了一套系统 jQuery Mobile是jQuery 在手机上和平板设备上的版本.jQuery ...
- JQuery mobile中按钮自定义属性的改变
1..ui-mobile-viewport是jquery mobile默认给body加的class,这样的话包含选择符优先级高一点 <style> .ui-mobile-viewport ...
- JQuery Mobile 页面参数传递
在单页模版中使用基于HTTP的方式通过POST和GET请求传递参数,而在多页模版中不需要与服务器进行通信,通常在多页模版中有以下三种方法来实现页面间的参数传递. 1.GET方式:在前一个页面生成参数并 ...
随机推荐
- CEF3开发者系列之JS与C++交互之一
JS与Native交互是相对于比较困难的技术,在学习这门技术之前,我们先了解下浏览器内核中的JS引擎与chromium内核的V8引擎相关知识.在浏览器应用中,JS与本地代码互相调用,得益于浏览器内核对 ...
- linux学习中遇到的各种故障与解决方法
一.nginx 二.apache 三.mysql 四.tomcat 五.oracle 六.python python安装mysqldb(mysql-devel包)出现错误: error: comman ...
- rman
http://wenku.baidu.com/link?url=UGVBgYKaKoT7_KI-jpj3BG0XF_7_kpZBZLoXD-9uTQkpw-brlacrkVNcfkHEXuax4ahc ...
- ACM/ICPC 之 模拟 (HNUOJ 13391-换瓶模拟)
题意:汽水瓶有三个部分cap+plastic bottle+ label(瓶盖-瓶身-瓶底),给出数据:n为原瓶数,x,y,z为这三个部分可以用相应的数字换取新瓶子,求最大总瓶数. 模拟(暴力) // ...
- TokuDB 引擎安装测试
背景: TokuDB引擎是有Tokutek开发的一个数据库存储引擎,在设计之初便引入了独特的索引算法,在其官网测试的文章中看到TokuDB性能比InnoDB高出很多. MySQL是一个插件式的数据库, ...
- WebLogic部署
1.抓取解压WAR包,放在相应目录下 2.登录部署,激活 http://jingyan.baidu.com/article/c74d6000650d470f6b595d72.html Linux环境中 ...
- ABAP 内表的行列转换-NEW
REPORT Z_TEST_COL_TO_ROW. TYPE-POOLS: slis. TABLES: mseg,mkpf. DATA: gd_fieldcat TYPE slis_t_fieldca ...
- 【Android】如何将eclipse工程导入studio
1.eclipse工程右键->export->Generate Gradle build files 2.studio->New->import project->选择工 ...
- Effective C++ -----条款52:写了placement new 也要写 placement delete
当你写一个placement operator new ,请确定也写出了对应的placement operator delete.如果没有这样做,你的程序可能会发生隐微而时断时续的内存泄漏. 当你声明 ...
- Greedy:Sum of Consecutive Prime Numbers(POJ 2739)
素数之和 题目大意:一些整数可以表示成一个连续素数之和,给定一个整数要你找出可以表示这一个整数的连续整数序列的个数 方法:打表,然后用游标卡尺法即可 #include <iostream> ...