日期插件rolldate.js的使用
下载地址:
效果:
代码:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <link rel="stylesheet" href="js/rolldate/rolldate.css" /> <title>日期插件</title> <style> input{ display: block; border-radius: 4px; outline: none; border: 1px solid #ccc; width: 200px; height: 30px; margin: 20px auto; padding-right: 10px; text-align: right; } </style> </head> <body> <input readonly type="text" id="date" placeholder="yy-mm-dd" /> <script src="js/jquery-3.2.1.min.js"></script> <script src="js/rolldate/rolldate.js"></script> <script> $(function() { new rolldate.date({ el: "#date", format: "yyyy-mm-dd", beginyear: 2000, endyear: 2100, theme: "blue", tapbefore: function(el) { console.log("插件开始触发"); }, moveend: function(el, iscroll) { console.log("滚动结束"); }, confirmbefore: function(el, date) { console.log("确定按钮触发"); }, confirmend: function(el, date) { console.log("插件运行结束"); } }); }); </script> </body> </html>
如对本文有疑问, 点击进行留言回复!!
VScode中的react自动补全标签代码及黄色or红色警告
关于React处理input的方法和多个input共用一个方法(不用jQuery)
网友评论