教你敲代码实现在线电影票选座功能

阅读: 评论:0

教你敲代码实现在线电影票选座功能⽹上购票如此的⽅便,那么我们能⽤HTML5+JavaScript实现⼀款在线电影票的选票功能吗?
答案是肯定的,今天我们就来借助jQuery的jQuery-Seat-Charts插件来实现在线电影票选座功能。
本案例(科⽂中⼼电影院)⽀持在线选座,票数统计,结算等功能。
根据上⾯的实例,我相信你们可以制作⼀款针对12306的在线选⽕车票的效果,汽车票也⼀样。
下⾯看看具体的实现代码:
浙江疫情最新消息<div class="demo">
<div id="seat-map">
<div class="front">屏幕</div>
河南省旅游景点地图</div>
洛阳旅游年票办理<div class="booking-details">
<p>影⽚:<span>星际穿越3D</span></p>
<p>时间:<span>11⽉14⽇ 21:00</span></p>
<p>座位:</p>
<ul id="selected-seats"></ul>
<p>票数:<span id="counter">0</span></p>
<p>总计:<b>¥<span id="total">0</span></b></p>
<button class="checkout-button">确定购买</button>
<div id="legend"></div>
</div>
</div>
剩下的最主要的是使⽤CSS将页⾯中的各个元素美化。包括电影院布局,座位布局,选票功能实现,实时统计票数等功能。精准天气预报
.front{width: 300px;margin: 5px 32px 45px 32px;background-color: #f0f0f0; color: #666;text-align: center;padding:
3px;border-radius: 5px;}
.booking-details {float: right;position: relative;width:200px;height: 450px; }
.booking-details h3 {margin: 5px 5px 0 0;font-size: 16px;}
.booking-details p{line-height:26px; font-size:16px; color:#999}
.booking-details p span{color:#666}
div.seatCharts-cell {color: #182C4E;height: 25px;width: 25px;line-height: 25px;margin: 3px;float: left;text-align:
center;outline: none;font-size: 13px;}
西递宏村在安徽哪里div.seatCharts-seat {color: #fff;cursor: pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius: 5px;}
div.seatCharts-row {height: 35px;}
div.seatCharts-seat.available {background-color: #B9DEA0;}
div.seatCharts-seat.focused {background-color: #76B474;border: none;}
div.seatCharts-seat.selected {background-color: #E6CAC4;}
div.seatCharts-seat.unavailable {background-color: #472B34;cursor: not-allowed;}
div.seatCharts-container {border-right: 1px dotted #adadad;width: 400px;padding: 20px;float: left;}
div.seatCharts-legend {padding-left: 0px;position: absolute;bottom: 16px;}
ul.seatCharts-legendList {padding-left: 0px;}
.seatCharts-legendItem{float:left; width:90px;margin-top: 10px;line-height: 2;}
span.seatCharts-legendDescription {margin-left: 5px;line-height: 30px;}
.checkout-button {display: block;width:80px; height:24px; line-height:20px;margin: 10px auto;border:1px solid #999;font-size: 14px; cursor:pointer}
#selected-seats {max-height: 150px;overflow-y: auto;overflow-x: none;width: 200px;}
飞机实时动态查询#selected-seats li{float:left; width:72px; height:26px; line-height:26px; border:1px solid #d3d3d3; background:#f7f7f7; margin:6px; font-size:14px; font-weight:bold; text-align:center}
最后引⼊我们的jQuery的jQuery-Seat-Charts插件
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.seat-charts.min.js"></script>
在调⽤该插件的seatCharts()⽅法即可实现电影票选票功能的渲染。
$('#seat-map').seatCharts()
以上就是⼤致的电影院选票功能的实现。
关注爱尚教育!私信⼩编156********!欢迎加⼊IT学习交流!获取更多新鲜资讯哦~给你IT学习以帮助!156********

本文发布于:2023-06-05 07:48:28,感谢您对本站的认可!

本文链接:http://www.035400.com/whly/1/457454.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

下一篇:12306订票难
标签:功能   实现   学习   获取   选票   相信   布局   电影院
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2024-2030 Comsenz Inc.Powered by © 文化旅游网 滇ICP备2022007236号-403 联系QQ:1103060800网站地图