js 日期插件 datepicker
2016-06-15 09:39
465 查看
点击图片出现 时间 ,增加一个点击事件
引入
<?php $this->registerCssFile('@web/assets/datepicker/css/bootstrap-datepicker3.min.css', ['position' => View::POS_BEGIN]) ?>
<?php $this->registerJsFile('@web/assets/datepicker/js/bootstrap-datepicker.min.js', ['position' => View::POS_BEGIN]) ?>
<?php $this->registerJsFile('@web/assets/datepicker/locales/bootstrap-datepicker.zh-CN.min.js', ['position' => View::POS_BEGIN]) ?>
增加点击事件
<label for="" class="width80">创建日:</label> <div class="input-group"> <div class="date"> <?= Html::TextInput('search[begin_date]', isset($searchParams['begin_date']) ? $searchParams['begin_date'] : '', ['id' => 'begin_date', 'class' => 'form-control border0 border-radius0', 'style' => "width: 115px;"]) ?> </div> <div class="input-group-addon white border0 border-radius0"> <i class="iconfont"></i> </div> </div>
引入
<?php $this->registerCssFile('@web/assets/datepicker/css/bootstrap-datepicker3.min.css', ['position' => View::POS_BEGIN]) ?>
<?php $this->registerJsFile('@web/assets/datepicker/js/bootstrap-datepicker.min.js', ['position' => View::POS_BEGIN]) ?>
<?php $this->registerJsFile('@web/assets/datepicker/locales/bootstrap-datepicker.zh-CN.min.js', ['position' => View::POS_BEGIN]) ?>
$("#begin_date").datepicker({ format: 'yyyy-mm-dd', language: 'zh-CN', autoclose: true, }).on('show', function () { var $datepick = $(".datepicker"); var bottom = $datepick.position().bottom; });
增加点击事件
/* datepicker bind icon show*/ $(function(){ $(".input-group-addon").click(function(){ $(this).prev().find("input").focus(); }) });
相关文章推荐
- XML和JSON的区别
- JS中的prototype
- JavaScript仿flash遮罩动画效果
- Javascript return false的作用(转)
- [Effective JavaScript 笔记]第35条:使用闭包存储私有数据
- [Effective JavaScript 笔记]第34条:在原型中存储方法
- JavaScript 基础知识--对象
- 手机浏览器调用手机qq客户端的js
- Valid Palindrome
- EL表达式常见用法
- JavaScript中的事件委托
- JS中showModalDialog 详细使用
- js时间比较
- jsf
- JSTL(自定义标签)
- JSP中include指令和include动作的区别
- [学习笔记]初识javascript
- Implement strStr() - Javascript
- Two Sum
- Javascript 创建对象的6种方法