移动端jquery-pie-loader动态饼状图以及mobiscroll时间控件(最新版)
来源:互联网 发布:淘宝网网 编辑:程序博客网 时间:2024/05/17 21:23
效果图如下:
1.动态饼状图
1.jquery-pie-loader的插件需要的css和js网上下载即可
<!-- 饼状图 --><link href="zzsc-demo.css" rel="stylesheet" type="text/css"><link href="jquery-pie-loader.css" rel="stylesheet" type="text/css"><script src="jquery-pie-loader.js" type="text/javascript"></script>
2.html页面需要的标签必写
<section class="zzsc-container"> <figure id="pie" data-behavior="pie-chart"></figure> </section>
3.js的渲染
/* 饼状图页面初始化 ,参数是直接放在input里面保留的*/<input type='hidden' value='${profit}' class='num'> //后台传过来的初始化参数 var num = ''; var rand = function() { num = $('.num').val(); return num; //该值为后台传过来的数据;js里面有两个相对应的值必须一致 } $('*[data-behavior="pie-chart"]').each(function() { $(this).svgPie({ percentage: rand(), dimension: 150 }); }); /* 点击查询时候的重新绘制,需把初次绘制的$('#pie')标签删除再插入绘制 */ $('.btnsubmit').on('click',function(){ var startDate = $("#startDate").val(); var endDateTime = $("#endDateTime").val(); $.post("#",{startDate:startDate,endDateTime:endDateTime},function(data){ $('.num').val(''); $('.num').val(data.profit); num = parseFloat($('.num').val()); $('#pie').remove(); $('.zzsc-container').html('<figure id="pie" data-behavior="pie-chart"></figure>') $('*[data-behavior="pie-chart"]').each(function() { $(this).svgPie({ percentage: rand(), dimension: 150 }); }); }); })
mobiscroll时间控件
1.需要的css和js官方都可以下载,我是用的网上做好的demo
<!-- 时间插件 --><link href="mobiscroll/mobiscroll_002.css" rel="stylesheet" type="text/css"><link href="mobiscroll/mobiscroll.css" rel="stylesheet" type="text/css"><link href="mobiscroll/mobiscroll_003.css" rel="stylesheet" type="text/css"><script src="mobiscroll/mobiscroll_002.js" type="text/javascript"></script><script src="mobiscroll/mobiscroll.js" type="text/javascript"></script>
2.html页面
<div class="startTime"> <label for="appDate">开始时间</label> <input value="" class="" readonly="readonly" id="startDate" type="text"></div> <div class="endTime"> <label for="appDate">结束时间</label> <input value="" class="" readonly="readonly" id="endDateTime" type="text"></div>
3.js部分
var currYear = (new Date()).getFullYear(); var opt={}; opt.date = {preset : 'date'}; opt.default = { theme: 'android-ics light', //皮肤样式android-ics display: 'modal', //显示方式 mode: 'scroller', //日期选择模式 dateFormat: 'yyyy-mm-dd', lang: 'zh', showNow: true, nowText: "今天", startYear: currYear, //开始年份 endYear: currYear+10,//结束年份 onSelect: function (valueText, inst) { var id = $(this)[0].id; var validity = valueText.split("-"); if (id == "startDate") { if (opt.default.maxDate) { opt.default.maxDate = null; } opt.default.minDate = new Date(validity[0], +validity[1] - 1, +validity[2] + 1); $("#endDateTime").mobiscroll($.extend(opt['date'], opt["default"])); } } }; $("#startDate").mobiscroll($.extend(opt['date'], opt["default"])); $("#endDateTime").mobiscroll($.extend(opt['date'], opt["default"])); //默认为当前时间,控制起始时间为当前日期 var date = new Date(); $("#startDate").val( date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()) $("#endDateTime").val( date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()) //阻止input访问手机键盘 $("#startDate").focus(function(){ document.activeElement.blur(); }); $("#endDateTime").focus(function(){ document.activeElement.blur(); });
阅读全文
0 0
- 移动端jquery-pie-loader动态饼状图以及mobiscroll时间控件(最新版)
- 移动端时间插件mobiscroll以及饼状进度图pie-loader
- 移动端mobiscroll时间控件的使用
- jquery.mobiscroll 适合移动端使用的滑动选择控件 -- 自定义选项示例
- Mobiscroll控件动态绑定数据
- jQuery Mobile 移动网站开发之日期控件Mobiscroll 2.5 使用说明
- jQuery Mobile 移动网站开发之日期控件Mobiscroll 2.5 使用说明
- jQuery Mobile 移动网站开发之日期控件Mobiscroll 2.5 使用说明
- 移动端时间控件
- jQuery Mobile 移动开发中的日期插件Mobiscroll 2.3 使用说明
- jQuery Mobile 移动开发中的日期插件Mobiscroll 2.3 使用说明
- 推荐手机端时间插件mobiscroll
- 关于mobiscroll时间控件没能正常绑定值问题
- mobiscroll 时间选择器小结
- mobiscroll 日期控件
- mobiscroll控件学习
- jquery mobiscroll 滑动、滚动
- 移动端选择插件mobiscroll.2.17的简化Demo
- 【求助】新手根据LibSVM学习详细说明中进行easy.py的试验但是出错了,请问如何解决?
- windows server 2012 IIS FTP 配置笔记
- utils/deb_resign.sh
- MVC介绍1
- 使用Matalab封装动态链接库(dll)供.NET(C#)调用
- 移动端jquery-pie-loader动态饼状图以及mobiscroll时间控件(最新版)
- [Easy]CodeForces
- 原生ajax和jQuery的ajax
- iOS 11 NSPhotoLibraryAddUsageDescription崩溃
- beyond compare 设置 FTP 工作在被动模式
- 论文笔记:A survey of recent advances in CNN-based single image crowd counting and density estimation
- 透明度浏览器兼容
- EdiuPlus根据ip地址连接虚拟主机
- Reactnative windows的配置