UNPKG

hg-datepicker

Version:

a datepicker in the mobile terminal

81 lines (78 loc) 2.29 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="format-detection" content="telephone=no" /> <meta name="screen-orientation" content="portrait" /> <title>hg-datepicker</title> <style> * { padding: 0; margin: 0; } body { background-color: #fff; } .wraper { margin-bottom: 15px; text-align: center; } .title { position: relative; width: 100%; height: 48px; line-height: 48px; text-align: center; color: #000; } .title:after { content: ''; position: absolute; width: 100px; height: 5px; left: 48%; bottom: 0; margin: 0 -42px; background: #bbb; border-radius: 10px; } .inputDiv { color: #333; width: 200px; height: 20px; line-height: 20px; margin: 10px auto; padding: 5px 20px; border: 1px solid #bbb; border-radius: 8px; } </style> </head> <body> <article class="wraper"> <h3 class="title">datePicker</h3> <div class="inputDiv" onclick="select(1)" id="date-input1">选择年月日</div> </article> <article class="wraper"> <h3 class="title">datePicker2</h3> <div class="inputDiv" onclick="select(2)" id="date-input2">选择年月日</div> </article> <article class="wraper"> <h3 class="title">timeSelector</h3> <div class="inputDiv" onclick="select2()" id="time-input">选择时分</div> </article> <article class="wraper"> <h3 class="title">dateTimeSelector</h3> <div class="inputDiv" onclick="select3()" id="datetime-input">选择年月日时分</div> </article> <article class="wraper"> <h3 class="title">monthSelector</h3> <div class="inputDiv" onclick="select4()" id="month-input">选择年月</div> </article> <article class="wraper"> <div onclick="setValue([1994, 10])">设置 monthSelector 的时间为 1994年10月</div> <div onclick="destroy()">销毁monthSelector</div> </article> </body> </html>