js+csss實現的一個帶複選框的下拉框,jscsss

來源:互聯網
上載者:User

js+csss實現的一個帶複選框的下拉框,jscsss

:

css:

<style type="text/css"> /* 帶複選框的下拉框 */ ul li{ list-style: none; padding:0px; margin: 0px; } .select_checkBox{ border:0px solid red; position: relative; display:inline-block; } .chartQuota{ height:23px; float:left; display:inline-block; border:0px solid black; position: relative; } .chartOptionsFlowTrend{ z-index:300; background-color:white; border:1px solid gray; display:none; position: absolute; left:0px; top:23px; width:150px; } .chartOptionsFlowTrend ul{ float:left; padding: 0px; margin: 5px; } .chartOptionsFlowTrend li{ /* float:left; */ display:block; position: relative; left:0px; margin: 0px; clear:both; } .chartOptionsFlowTrend li *{ float:left; } a:-webkit-any-link { color: -webkit-link; text-decoration: underline; cursor: auto; } .chartQuota p a { float: left; height: 21px; outline: 0 none; border: 1px solid #ccc; line-height: 22px; padding: 0 5px; overflow: hidden; background: #eaeaea; color: #313131; text-decoration: none; } .chartQuota p { margin:0px; folat:left; overflow: hidden; height: 23px; line-height:24px; display: inline-block; } .chartOptionsFlowTrend p { height: 23px; line-height: 23px; overflow: hidden; position: relative; z-index: 2; background: #fefbf7; padding-top: 0px; display: inline-block; } .chartOptionsFlowTrend p a { border: 1px solid #fff; margin-left: 15px; color: #2e91da; } </style>

html:

<div class="select_checkBox"> <div class="chartQuota"> <p> <a href="javascript:;" hidefocus="true" title="請選擇指標"><span>選擇指標</span> <b></b> </a> </p> </div><br> <div class="chartOptionsFlowTrend""> <ul> <li class=""><input type="checkbox" value="1"><span>瀏覽次數(PV)</span> </li> <li class=""><input type="checkbox" value="1"><span>獨立訪客(UV)</span> </li> <li class=""><input type="checkbox" value="1"><span>IP</span> </li> <li class=""><input type="checkbox" value="1"><span>新獨立訪客</span> </li> <li class=""><input type="checkbox" value="1"><span>訪問次數</span> </li> </ul> <p> <a href="javascript:;" title="確定" hidefocus="true" class="a_0">確定</a><a href="javascript:;" title="取消" hidefocus="true" class="a_1">取消</a> </p> </div> </div>

js:

<script type="text/javascript"> $(function(){ $(".select_checkBox").hover(function(){ $(".chartOptionsFlowTrend").css("display","inline-block"); },function(){ $(".chartOptionsFlowTrend").css("display","none"); }); }); </script>

js下拉框控制複選框的問題

這個問題 說簡單 挺簡單 說難挺難 如果 你會 hibernate 就自定綁定了 會 下拉框是以value定義的,value的現值就是你已經選擇的值,直接用value的值
 
一個 javascript下拉框聯動複選框的程式

這裡有一個多級聯動select效果
可以參考一下
參考資料:www.blueidea.com/...=11685
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.