网络编程 发布日期:2024/11/6 浏览次数:1
手机端一部分用flex布局写在这里看着不爽把css全部删除了。只留下js结算功能js很臃肿,请留下宝贵意见提升性能。改天上多店铺购物车手机端原版截图
效果图:
图(1)全部勾选的效果
图(2)勾选,点击“删除”效果
代码如下:
<!DOCTYPE html> <html lang="zh-cn"> <head> <title>购物车</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <!----确保适当的绘制和触屏缩放,让网页的宽度自动适应手机屏幕的宽度----> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/> <!----关键词搜索----> <meta name="keywords" content=""> <!----描述网页的核心内容,通常为网页内容的摘要信息----> <meta name="description" content="" /> <meta name="format-detection" content="telephone=no" /> <meta name="format-detection" content="email=no" /> <link rel="stylesheet" href="css/basic.css" rel="external nofollow" > <link rel="stylesheet" href="css/css.css" rel="external nofollow" > </head> <style> .flex-center{ display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -o-box; display: box; -webkit-box-pack: center; -moz-box-pack: center; -ms-flex-pack: center; -o-box-pack: center; box-pack: center; -webkit-box-align: center; -moz-box-align: center; -ms-flex-align: center; -o-box-align: center; box-align: center; } .kong{ font-size: 0.3rem; height: 80vh; color: #333333; } .kong a { color: #333333; text-decoration: double; } </style> <body> <main class="dfk_main"> <dl class="gwc_dl"> <dt class="gwc_dt"><label class="gwc_1 gwc_spxz"><input type="checkbox" class="gwc_qx2 GoodsCheck" value=""></label></dt> <dd class="gwc_dd2">零食 <span>¥<span class="gwc_dd_p">1.00</span></span> <span class="spjj gwc_jj"> <input type="button" class="jian" value="-"><input type="text" class="shuliang" value="1"><input type="button" class="jia" value="+"> </span></dd> </dl> <dl class="gwc_dl"> <dt class="gwc_dt"><label class="gwc_1 gwc_spxz"><input type="checkbox" class="gwc_qx2 GoodsCheck" value=""></label></dt> <dd class="gwc_dd2">零食 <span>¥<span class="gwc_dd_p">1.00</span></span> <span class="spjj gwc_jj"> <input type="button" class="jian" value="-"><input type="text" class="shuliang" value="1"><input type="button" class="jia" value="+"> </span></dd> </dl> <section class="gwc_delectbtn"> <button type="button" class="delete">删除</button><p>共 <span class="colb51 gwc_sl">0</span> 件商品 共计:¥<span class="ShopTotal">0.00</span></p> </section> </main> <footer class="gwc_footer"> <form action="#" method="get"> <p class="gwc_qx"><label class="gwc_1 gwc_label"><input type="checkbox" class="gwc_qx2 ShopCheck" value=""></label><span>全选</span> <span class="gwc_jsp"><span >合计:¥<b class="ShopTotal">0.00</b></span><span>不含邮费</span></span> <button type="button" class="gwc_btnjs">结算(<span class="gwc_sl">0</span>)</button> </p> </form> </footer> <script src="/UploadFiles/2021-04-02/jquery.js">以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持!