先來(lái)看效果 然后上代碼: 先來(lái)DIV代碼 <!-- 分類篩選 --> <div class="my-3"> <div class="row"> <div class="col-12 col-sm-2 col-md-1">類型:</div> <div class="col-12 col-sm-10 col-md-11"> <select class="footer_sel" id="FriendLink"> <option selected="selected" value="#">選擇分類</option> {pboot:select field=ext_type} <option {pboot:if('[select:value]'=='[select:current]' )}selected="selected" {/pboot:if} value="[select:link]">[select:value]</option> {/pboot:select} </select> </div> </div> <div class="row"> <div class="col-12 col-sm-2 col-md-1">顏色:</div> <div class="col-12 col-sm-10 col-md-11"> <select class="footer_sel" id="FriendLink2"> <option selected="selected" value="#">選擇分類</option> {pboot:select field=ext_color} <option {pboot:if('[select:value]'=='[select:current]' )}selected="selected" {/pboot:if} value="[select:link]">[select:value]</option> {/pboot:select} </select> </div> </div> </div> 然后JQ代碼 <script> (function(window, $) { function init() { bindEvt(); } init(); function bindEvt() { $("#FriendLink").bind("change", function() { var selectedHref = $("#FriendLink :selected").val(); if (selectedHref != "") { window.open(selectedHref, "_self"); } }); } function init2() { bindEvt2(); } init2(); function bindEvt2() { $("#FriendLink2").bind("change", function() { var selectedHref = $("#FriendLink2 :selected").val(); if (selectedHref != "") { window.open(selectedHref, "_self"); } }); } })(window, jQuery); </script> |
免責(zé)聲明:本站部分文章和圖片均來(lái)自用戶投稿和網(wǎng)絡(luò)收集,旨在傳播知識(shí),文章和圖片版權(quán)歸原作者及原出處所有,僅供學(xué)習(xí)與參考,請(qǐng)勿用于商業(yè)用途,如果損害了您的權(quán)利,請(qǐng)聯(lián)系我們及時(shí)修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長(zhǎng)、創(chuàng)業(yè)、互聯(lián)網(wǎng)等領(lǐng)域,為您提供最新最全的互聯(lián)網(wǎng)資訊,幫助站長(zhǎng)轉(zhuǎn)型升級(jí),為互聯(lián)網(wǎng)創(chuàng)業(yè)者提供更加優(yōu)質(zhì)的創(chuàng)業(yè)信息和品牌營(yíng)銷服務(wù),與站長(zhǎng)一起進(jìn)步!讓互聯(lián)網(wǎng)創(chuàng)業(yè)者不再孤獨(dú)!
掃一掃,關(guān)注站長(zhǎng)網(wǎng)微信