仿仿滴滴时间控制选择器(前端-移动端)

本文介绍了如何在前端移动端创建一个仿照滴滴出行应用的时间选择器。通过HTML、CSS和JavaScript实现,允许用户精确控制选择时间。
摘要由CSDN通过智能技术生成

 效果

 

 

HTML

<body>
	<div class="time-box">
		<div>
			<span class="time_span1">上门时间:</span>
			<input type="text" id="time" readonly placeholder="请选择上门时间" />
		</div>
	</div>
	<div class="time-controller">
		<div class="time-controller-all">
			<div class="time-controller-choice border-bottom">
				<span class="cancel">取消</span>
				<span class="sure">确定</span>
				<h1 class="time-controller-top">选择时间</h1>
			</div>
			<div class="time-controller-content">
				<div class="time-package-top border-bottom"></div>
				<div class="time-package-bottom border-top"></div>
				<div class="time-package">
					<div class="time">
						<ul class="time-list diff">
						</ul>
					</div>
					<div class="time">
						<ul class="time-list">
						</ul>
					</div>
					<div class="time">
						<ul class="time-list">
						</ul>
					</div>
				</div>
			</div>
			<div class="time-controller-bottom"></div>
		</div>
	</div>
</body>

CSS 

<style>
	.time-box {
		border: 1px solid #F2F2F2;
		margin-left: 10px;
		height: 70px;
	}

	.time-box>div {
		width: 100%;
		padding-top: 27px;
	}

	.time_span1 {
		margin-left: 10px;
	}

	.time-box input {
		border: 0px;
		outline:none;
		cursor: pointer;
		width: 45%;
		margin-left: 22px;
	}
	
	.time-controller {
		position: fixed;
		left: 0;
		top: 0;
		z-index: 100;
		width: 100%;
		height: 100%;
		overflow: hidden;
		text-align: center;
		font-size: 14px;
		background-color: rgba(37, 38, 45, .4);
	}

	.time-controller .time-controller-all {
		position: absolute;
		z-index: 600;
		bottom: 0;
		width: 100%;
		height: 273px;
		background: #fff;
	}

	.time-controller .time-controller-all .time-controller-choice {
		position: relative;
		height: 60px;
		color: #999;
	}

	.time-controller .time-controller-all .time-controller-content {
		position: relative;
		top: 20px;
		height: 173px;
	}

	.border-bottom,
	.border-top {
		position: relative;
	}

	.border-bottom:after,
	.border-bottom:before,
	.border-top:after,
	.border-top:before {
		content: "";
		display: block;
		position: absolute;
		-webkit-transform-origin: 0 0;
		transform-origin: 0 0;
	}

	.border-bottom:after {
		border-bottom: 1px solid #ebebeb;
		left: 0;
		bottom: 0;
		width: 100%;
		-webkit-transform-origin: 0 bottom;
		
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值