mobiscroll自定义年月日选择的应用
来源:互联网 发布:打字用什么软件 编辑:程序博客网 时间:2024/06/07 06:06
在angular中使用mobiscroll插件实现效果如图:
类似的效果。
代码如下:
html:
<div class="BasicInfo" style="width: 100%;"> <div>请选择会计期间</div></div><ul class="sPlist" style="position: fixed;top: 42px;left: 0;border-bottom: 10px solid #f0f0f5;"> <li class="listLi clear"> <div style="width: 90%;margin-left:10%;"> <p style="width: 32%;display: inline-block;"> <input style="display: inline-block;width: 60%;text-align: center;" type="text" ng-model="dateYear" mobiscroll-number="Year" placeholder="请选择" />年 </p> <p style="width: 32%;display: inline-block;"> <input style="display: inline-block;width: 60%;text-align: center;" type="text" ng-model="datemonthstart" mobiscroll-number="monthstart" placeholder="请选择"/>月 到 </p> <p style="width: 32%;display: inline-block;"> <input style="display: inline-block;width: 60%;text-align: center;" type="text" ng-model="datemonthend" mobiscroll-number="monthend" placeholder="请选择"/>月 </p> </div> </li></ul>
js:
angular.module('starter.zhangWuChaXunControllers', ['ionic','mobiscroll-number','mobiscroll-scroller'])//要加上mobiscroll-scroller.controller('zhangWuChaXunCtrl', function($scope, $rootScope, $state, $http, CONFIG, tool, zhangHuChaXunService) { //$state路由跳转页面 console.log(zhangHuChaXunService); var currYear = (new Date()).getFullYear(); //当前年份 $scope.Year = { theme: 'mobiscroll', lang: 'zh', display: 'center', /*layout: 'fixed',*/ min:2010, max: currYear+1, step: 1, cancelText: '取消', setText: '确定', onBeforeClose: function(event, inst) { if(event.button == "set") { $scope.start = event.valueText;//获取选择日期 console.log($scope.start) } else if(event.button == "cancel") { console.log("取消") } } }; $scope.monthstart = { theme: 'mobiscroll', lang: 'zh', display: 'center', min:1, max: 12, step: 1, cancelText: '取消', setText: '确定', onBeforeClose: function(event, inst) { if(event.button == "set") { $scope.start = event.valueText;//获取选择日期 console.log($scope.start) } else if(event.button == "cancel") { console.log("取消") } } }; $scope.monthend = { theme: 'mobiscroll', lang: 'zh', display: 'center', min:1, max: 12, step: 1, cancelText: '取消', setText: '确定', onBeforeClose: function(event, inst) { if(event.button == "set") { $scope.start = event.valueText;//获取选择日期 console.log($scope.start) } else if(event.button == "cancel") { console.log("取消") } } };})
0 0
- mobiscroll自定义年月日选择的应用
- mobiscroll的简单应用(select、年月日)
- mobiscroll实现年月日分别选择
- 日期选择控件mobiscroll 自定义样式
- jquery.mobiscroll 适合移动端使用的滑动选择控件 -- 自定义选项示例
- 选择年月日的方法
- jquery mobiscroll 滑动、滚动及实现自定义选择
- 移动端选择插件mobiscroll.2.17的简化Demo
- 移动端选择插件mobiscroll的使用demo
- mobiscroll时间选择器(年月日时分)
- mobiscroll 自定义dialog
- mobiscroll 二级联动,选择地址
- javascript实现年月日的联动选择
- mobiscroll的具体用法
- mobiscroll
- mobiscroll
- 表单中日期选择、年月日时分秒的选择
- Mobiscroll — 配合jQuery Mobile 的日期选择控件附DEMO
- ChucK初步(11)
- Android简介
- 完美解决Genymotion无法使用adb命令的问题
- JVM监控工具介绍jstack, jconsole, jinfo, jmap, jdb, jstat
- Linux最大线程数限制及当前线程数查询
- mobiscroll自定义年月日选择的应用
- 以SYSTEM用户运行CMD
- Python-切片的理解(Slicing)
- JVM调优
- cygwin的安装及编译和调试程序
- Lua - 19
- javascript基础(数值,布尔值,Null和Undefined)(五)
- 分区建表1
- Android开发——UI_片段