jQuery电脑手机端通用银行选择下拉菜单

2676次浏览推荐于2021.09.07

jQuery电脑手机端通用银行选择下拉菜单

    操作方法

    • 01

      准备好需要用到的图标。这里还需要自己准备银行卡logo图标

      • 02

        新建html文档。

        • 03

          书写hmtl代码。 <div class="container-fluid" id="con"> <div class="row bg-fff  par-top-40 pad-right-15" id="bank_show1"  > <table class="table"> <tr> <td class="form_td border-none td_bot" >姓名</td><td class="border-none td_bot"><input type="text" class="form-control" placeholder="请输入姓名"/></td> </tr> <tr> <td class="form_td border-none td_bot">身份证号</td><td class="border-none td_bot"><input type="text" class="form-control" placeholder="请输入身份证号"/></td> </tr> <tr> <td class="form_td border-none td_bot">选择银行</td> <td class="border-none td_bot"> <div class="position-rel"> <div class="position-rel"> <input type="text" id="chose_input"   class="form-control" placeholder="--储蓄卡--"/> <div class="bank_xljt"><img class="jt_xz" width="20" src="images/jtx.png" alt=""/></div> <div id="chose_bank" class="bank_xljt1"></div> </div> <div class="bank_xl" style="display: none"> <ul> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国农业银行"> <img src="images/zs1.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国建设银行"> <img src="images/zs2.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国工商银行"> <img src="images/zs3.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国银行"> <img src="images/zs4.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国光大银行"> <img src="images/zs5.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="华夏银行"> <img src="images/zs6.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="中国民生银行"> <img src="images/zs7.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="平安银行"> <img src="images/zs8.png" width="150" alt=""/> </a> </li> <li class="hotBank-list"> <a href="javascript:" class="hotBank-list-ico "  title="兴业银行"> <img src="images/zs9.png" width="150" alt=""/> </a> </li> </ul> </div> </div> </td> </tr> </table> </div> </div>

          • 04

            书写css代码。 .mar5 { margin-top: 6px; } .btn-to { position: fixed; width: 100%; max-width: 640px; bottom: 80px; } .bank_wz { background: #f6ac19; padding: 10px 0px; color: #fff; border-radius: 5px 5px 0px 0px; padding-left: 6%; padding-right: 6%; } .bank_wz1 { padding: 20px 0px; background: #fff; padding-left: 6%; padding-right: 6%; } .form_td { line-height: 34px !important; width: 94px; text-align: right; } .td_bot { padding: 10px 8px 0px 8px !important; } .bank_xl { width: 100%; border: 1px solid #ccc; border-top: 0px; border-bottom: 0px; position: absolute; z-index: 1; background: #ffffff; } .bank_xl>ul>li { padding-top: 4px; padding-bottom: 3px; border-bottom: 1px solid #ccc; padding-left: 5px; } .bank_xl>ul>li>a { display: block; width: 100%; } .bank_xljt { position: absolute; right: 0px; top: 1px; width: 50px; height: 33px; line-height: 33px; text-align: center; border-left: 1px solid #ccc; } .bank_xljt1 { height: 32px; position: absolute; width: 100%; top: 0px; } .td_run { width: 96px; text-align: right; } .border-orange { border: 1px solid #f6ac19; } .erdate { position: absolute; width: 15px; right: 27px; top: 13px; } .color-green { color: #27d8a1; } .line-height-34 { line-height: 34px !important; } .peerdiv_table { padding: 10px; box-shadow: 0px 0px 10px #DFDADA; } .abs-6 { position: absolute; top: 6px; left: 0px; display: none; }

            • 05

              书写并添加js代码。 <script src="js/jquery-1.11.1.min.js"></script> <script src="js/bs.js"></script> <script> $(function(){ $(".hotBank-list-ico").bind('click',function(){ $('#chose_input').val($(this).attr('title')); $('.bank_xl').hide(); $("#chose_bank").parent('div').find('img').addClass('jt_xz'); }); $("#chose_bank").click(function(){ $('.bank_xl').show(); $("#chose_bank").parent('div').find('img').removeClass('jt_xz'); }); }) </script> <script> if (navigator.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle = document.createElement('style') msViewportStyle.appendChild( document.createTextNode( '@-ms-viewport{width:auto!important}' ) ) document.querySelector('head').appendChild(msViewportStyle) } </script>

              • 06

                代码整体结构。

                • 07

                  查看效果。

                  • End

                  免责声明:

                  本页搜狗指南内容仅代表作者本人意见,若因此产生任何纠纷由作者本人负责,概与搜狗公司无关。本页搜狗指南内容仅供参考,请您根据自身实际情况谨慎操作。尤其涉及您或第三方利益等事项,请咨询专业人士处理。

                  0点赞无帮助无帮助
                  还没有个性签名哟
                  \\n\\n\\n\",\"pics\":[{\"url\":\"https://img04.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_294_20180906020708-1603843860\",\"width\":500,\"height\":294}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"代码整体结构。\",\"pics\":[{\"url\":\"https://img02.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_322_20180906020710-624577226\",\"width\":500,\"height\":322}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"查看效果。\",\"pics\":[{\"url\":\"https://img02.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_321_20180906020713-1857712547\",\"width\":500,\"height\":321}],\"refers\":[],\"method\":false,\"actionSensitive\":0}],\"methodKeyForShow\":0.0}],\"stepsForCatalog\":[{\"action\":\"操作方法\",\"pics\":null,\"refers\":null,\"method\":true,\"actionSensitive\":0},{\"action\":\"准备好需要用到的图标。这里还需要自己准备银行卡logo图标\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"新建html文档。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写hmtl代码。\\n
                  \\n
                  \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
                  姓名
                  身份证号
                  选择银行\\n
                  \\n
                  \\n\\n
                  \\\"\\\"/
                  \\n
                  \\n
                  \\n
                  \\n\\n
                  \\n
                  \\n
                  \\n
                  \\n
                  \",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写css代码。\\n.mar5 { margin-top: 6px; }\\n.btn-to { position: fixed; width: 100%; max-width: 640px; bottom: 80px; }\\n.bank_wz { background: #f6ac19; padding: 10px 0px; color: #fff; border-radius: 5px 5px 0px 0px; padding-left: 6%; padding-right: 6%; }\\n.bank_wz1 { padding: 20px 0px; background: #fff; padding-left: 6%; padding-right: 6%; }\\n.form_td { line-height: 34px !important; width: 94px; text-align: right; }\\n.td_bot { padding: 10px 8px 0px 8px !important; }\\n.bank_xl { width: 100%; border: 1px solid #ccc; border-top: 0px; border-bottom: 0px; position: absolute; z-index: 1; background: #ffffff; }\\n.bank_xl>ul>li { padding-top: 4px; padding-bottom: 3px; border-bottom: 1px solid #ccc; padding-left: 5px; }\\n.bank_xl>ul>li>a { display: block; width: 100%; }\\n.bank_xljt { position: absolute; right: 0px; top: 1px; width: 50px; height: 33px; line-height: 33px; text-align: center; border-left: 1px solid #ccc; }\\n.bank_xljt1 { height: 32px; position: absolute; width: 100%; top: 0px; }\\n.td_run { width: 96px; text-align: right; }\\n.border-orange { border: 1px solid #f6ac19; }\\n.erdate { position: absolute; width: 15px; right: 27px; top: 13px; }\\n.color-green { color: #27d8a1; }\\n.line-height-34 { line-height: 34px !important; }\\n.peerdiv_table { padding: 10px; box-shadow: 0px 0px 10px #DFDADA; }\\n.abs-6 { position: absolute; top: 6px; left: 0px; display: none; }\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写并添加js代码。\\n\\n\\n\\n\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"代码整体结构。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"查看效果。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0}],\"isOriginal\":true,\"createTime\":\"2018.09.07 17:18:43\",\"modifyTime\":\"2018.09.07\",\"prepare\":[{\"content\":\"adobe dreamweaver\",\"sensitive\":0}],\"tips\":null,\"tipsSensitive\":0,\"video\":null,\"videoInfo\":null,\"refers\":[],\"link\":\"http://jingyan.baidu.com/article/020278115ad5bc1bcc9ce5f3.html\",\"richPageInfo\":null,\"richPageInfoJson\":null,\"name\":\"\",\"foreignName\":\"\",\"mainItems\":null,\"assistItems\":null,\"taste\":null,\"difficulty\":0,\"shortName\":\"\",\"gameType\":null,\"developer\":null,\"platform\":null,\"source\":0},\"questionAnswer\":null,\"compoundKnowledge\":null,\"level\":0,\"original\":0,\"detailGuideType\":11,\"reproduceInfo\":null,\"optimised\":0,\"pv\":\"2676\",\"userOperate\":0,\"likeNum\":\"0\",\"unlikeNum\":\"0\",\"collected\":false}","cateId":"22"}){ window._gtag[key]={"guideId":"316513188004","likeNum":"0","unlikeNum":"0","title":"jQuery电脑手机端通用银行选择下拉菜单","userOperate":"0","relateSearchStyle":false,"isAdUser":false,"isDetailPage":true,"outSource":false,"topicName":"","detail":"{\"guideId\":\"316513188004\",\"type\":1,\"experience\":{\"type\":1,\"topicName\":null,\"question\":{\"questionId\":0,\"user\":{\"uin\":0,\"crypt\":\"_83b528817943583ef30a06aacbc30574\",\"name\":\"踏雪无痕\",\"head\":\"https://img01.sogoucdn.com/v2/thumb/retype/ext/auto/q/75/?appid=200698&url=https%3A%2F%2Fcache.soso.com%2Fqlogo%2Fg%3Fb%3Dqq%26k%3DfC0SN8SZIzYGEcElh2Mia0g%26s%3D140%26t%3D1370805009\",\"brief\":\"\",\"isAnony\":false,\"adUser\":false,\"origin\":0,\"grade\":3,\"rewardUserType\":0,\"website\":null,\"websiteForShow\":null,\"redirectType\":0,\"anony\":false},\"title\":\"jQuery电脑手机端通用银行选择下拉菜单\",\"content\":\"jQuery电脑手机端通用银行选择下拉菜单\",\"timestamp\":\"2018.09.06 02:07:15\",\"pics\":[],\"tags\":[],\"state\":0,\"refers\":[],\"aliasTitles\":null,\"likes\":0,\"level\":0,\"video\":false,\"titleSensitive\":0,\"contentSensitive\":0,\"catId\":22,\"catName\":null,\"catTags\":[],\"ad\":false,\"baike\":false,\"link\":null},\"steps\":null,\"multiSteps\":[{\"name\":\"操作方法\",\"nameSensitive\":0,\"steps\":[{\"action\":\"准备好需要用到的图标。这里还需要自己准备银行卡logo图标\",\"pics\":[{\"url\":\"https://img03.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=36_18_20180906020701-1775980831\",\"width\":36,\"height\":18},{\"url\":\"https://img04.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=32_17_20180906020703-1283340325\",\"width\":32,\"height\":17}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"新建html文档。\",\"pics\":[{\"url\":\"https://img03.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_260_20180906020704-1072063788\",\"width\":500,\"height\":260}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"书写hmtl代码。\\n
                  \\n
                  \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
                  姓名
                  身份证号
                  选择银行\\n
                  \\n
                  \\n\\n
                  \\\"\\\"/
                  \\n
                  \\n
                  \\n
                  \\n\\n
                  \\n
                  \\n
                  \\n
                  \\n
                  \",\"pics\":[{\"url\":\"https://img03.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_213_20180906020705-1514617450\",\"width\":500,\"height\":213}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"书写css代码。\\n.mar5 { margin-top: 6px; }\\n.btn-to { position: fixed; width: 100%; max-width: 640px; bottom: 80px; }\\n.bank_wz { background: #f6ac19; padding: 10px 0px; color: #fff; border-radius: 5px 5px 0px 0px; padding-left: 6%; padding-right: 6%; }\\n.bank_wz1 { padding: 20px 0px; background: #fff; padding-left: 6%; padding-right: 6%; }\\n.form_td { line-height: 34px !important; width: 94px; text-align: right; }\\n.td_bot { padding: 10px 8px 0px 8px !important; }\\n.bank_xl { width: 100%; border: 1px solid #ccc; border-top: 0px; border-bottom: 0px; position: absolute; z-index: 1; background: #ffffff; }\\n.bank_xl>ul>li { padding-top: 4px; padding-bottom: 3px; border-bottom: 1px solid #ccc; padding-left: 5px; }\\n.bank_xl>ul>li>a { display: block; width: 100%; }\\n.bank_xljt { position: absolute; right: 0px; top: 1px; width: 50px; height: 33px; line-height: 33px; text-align: center; border-left: 1px solid #ccc; }\\n.bank_xljt1 { height: 32px; position: absolute; width: 100%; top: 0px; }\\n.td_run { width: 96px; text-align: right; }\\n.border-orange { border: 1px solid #f6ac19; }\\n.erdate { position: absolute; width: 15px; right: 27px; top: 13px; }\\n.color-green { color: #27d8a1; }\\n.line-height-34 { line-height: 34px !important; }\\n.peerdiv_table { padding: 10px; box-shadow: 0px 0px 10px #DFDADA; }\\n.abs-6 { position: absolute; top: 6px; left: 0px; display: none; }\",\"pics\":null,\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"书写并添加js代码。\\n\\n\\n\\n\",\"pics\":[{\"url\":\"https://img04.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_294_20180906020708-1603843860\",\"width\":500,\"height\":294}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"代码整体结构。\",\"pics\":[{\"url\":\"https://img02.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_322_20180906020710-624577226\",\"width\":500,\"height\":322}],\"refers\":[],\"method\":false,\"actionSensitive\":0},{\"action\":\"查看效果。\",\"pics\":[{\"url\":\"https://img02.sogoucdn.com/v2/thumb/retype/ext/auto/q/90/?appid=200698&name=500_321_20180906020713-1857712547\",\"width\":500,\"height\":321}],\"refers\":[],\"method\":false,\"actionSensitive\":0}],\"methodKeyForShow\":0.0}],\"stepsForCatalog\":[{\"action\":\"操作方法\",\"pics\":null,\"refers\":null,\"method\":true,\"actionSensitive\":0},{\"action\":\"准备好需要用到的图标。这里还需要自己准备银行卡logo图标\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"新建html文档。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写hmtl代码。\\n
                  \\n
                  \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
                  姓名
                  身份证号
                  选择银行\\n
                  \\n
                  \\n\\n
                  \\\"\\\"/
                  \\n
                  \\n
                  \\n
                  \\n\\n
                  \\n
                  \\n
                  \\n
                  \\n
                  \",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写css代码。\\n.mar5 { margin-top: 6px; }\\n.btn-to { position: fixed; width: 100%; max-width: 640px; bottom: 80px; }\\n.bank_wz { background: #f6ac19; padding: 10px 0px; color: #fff; border-radius: 5px 5px 0px 0px; padding-left: 6%; padding-right: 6%; }\\n.bank_wz1 { padding: 20px 0px; background: #fff; padding-left: 6%; padding-right: 6%; }\\n.form_td { line-height: 34px !important; width: 94px; text-align: right; }\\n.td_bot { padding: 10px 8px 0px 8px !important; }\\n.bank_xl { width: 100%; border: 1px solid #ccc; border-top: 0px; border-bottom: 0px; position: absolute; z-index: 1; background: #ffffff; }\\n.bank_xl>ul>li { padding-top: 4px; padding-bottom: 3px; border-bottom: 1px solid #ccc; padding-left: 5px; }\\n.bank_xl>ul>li>a { display: block; width: 100%; }\\n.bank_xljt { position: absolute; right: 0px; top: 1px; width: 50px; height: 33px; line-height: 33px; text-align: center; border-left: 1px solid #ccc; }\\n.bank_xljt1 { height: 32px; position: absolute; width: 100%; top: 0px; }\\n.td_run { width: 96px; text-align: right; }\\n.border-orange { border: 1px solid #f6ac19; }\\n.erdate { position: absolute; width: 15px; right: 27px; top: 13px; }\\n.color-green { color: #27d8a1; }\\n.line-height-34 { line-height: 34px !important; }\\n.peerdiv_table { padding: 10px; box-shadow: 0px 0px 10px #DFDADA; }\\n.abs-6 { position: absolute; top: 6px; left: 0px; display: none; }\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"书写并添加js代码。\\n\\n\\n\\n\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"代码整体结构。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0},{\"action\":\"查看效果。\",\"pics\":null,\"refers\":null,\"method\":false,\"actionSensitive\":0}],\"isOriginal\":true,\"createTime\":\"2018.09.07 17:18:43\",\"modifyTime\":\"2018.09.07\",\"prepare\":[{\"content\":\"adobe dreamweaver\",\"sensitive\":0}],\"tips\":null,\"tipsSensitive\":0,\"video\":null,\"videoInfo\":null,\"refers\":[],\"link\":\"http://jingyan.baidu.com/article/020278115ad5bc1bcc9ce5f3.html\",\"richPageInfo\":null,\"richPageInfoJson\":null,\"name\":\"\",\"foreignName\":\"\",\"mainItems\":null,\"assistItems\":null,\"taste\":null,\"difficulty\":0,\"shortName\":\"\",\"gameType\":null,\"developer\":null,\"platform\":null,\"source\":0},\"questionAnswer\":null,\"compoundKnowledge\":null,\"level\":0,\"original\":0,\"detailGuideType\":11,\"reproduceInfo\":null,\"optimised\":0,\"pv\":\"2676\",\"userOperate\":0,\"likeNum\":\"0\",\"unlikeNum\":\"0\",\"collected\":false}","cateId":"22"}[key] }; window._gtag.detail = JSON.parse(window._gtag.detail || null);