JS-日期框、下拉框、全选复选框


<!-- 下拉框 -->
<link rel="stylesheet" href="static/ace/css/chosen.css" />

<!-- 日期框 -->
<link rel="stylesheet" href="static/ace/css/datepicker.css" />

<!-- 日期框 -->
<script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>

 


$(function() { //日期框 $('.date-picker').datepicker({ autoclose: true, todayHighlight: true }); //下拉框 if(!ace.vars['touch']) { $('.chosen-select').chosen({allow_single_deselect:true}); $(window) .off('resize.chosen') .on('resize.chosen', function() { $('.chosen-select').each(function() { var $this = $(this); $this.next().css({'width': $this.parent().width()}); }); }).trigger('resize.chosen'); $(document).on('settings.ace.chosen', function(e, event_name, event_val) { if(event_name != 'sidebar_collapsed') return; $('.chosen-select').each(function() { var $this = $(this); $this.next().css({'width': $this.parent().width()}); }); }); $('#chosen-multiple-style .btn').on('click', function(e){ var target = $(this).find('input[type=radio]'); var which = parseInt(target.val()); if(which == 2) $('#form-field-select-4').addClass('tag-input-style'); else $('#form-field-select-4').removeClass('tag-input-style'); }); } //复选框全选控制 var active_class = 'active'; $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){ var th_checked = this.checked;//checkbox inside "TH" table header $(this).closest('table').find('tbody > tr').each(function(){ var row = this; if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true); else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false); }); }); });

 18271929370这个百度云中有下载

http://pan.baidu.com/s/1nuVEPVb


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM