先來看效果 然后上代碼: 先來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> |
免責聲明:本站部分文章和圖片均來自用戶投稿和網(wǎng)絡收集,旨在傳播知識,文章和圖片版權(quán)歸原作者及原出處所有,僅供學習與參考,請勿用于商業(yè)用途,如果損害了您的權(quán)利,請聯(lián)系我們及時修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長、創(chuàng)業(yè)、互聯(lián)網(wǎng)等領(lǐng)域,為您提供最新最全的互聯(lián)網(wǎng)資訊,幫助站長轉(zhuǎn)型升級,為互聯(lián)網(wǎng)創(chuàng)業(yè)者提供更加優(yōu)質(zhì)的創(chuàng)業(yè)信息和品牌營銷服務,與站長一起進步!讓互聯(lián)網(wǎng)創(chuàng)業(yè)者不再孤獨!
掃一掃,關(guān)注站長網(wǎng)微信