本文介绍了对于eternicode Bootstap datepicker,无法获取jQuery调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我一直在尝试eternicode / bootstrap-datepicker()。我尝试了沙箱( ),只是想使用组件版本与今天突出显示。



我有两个问题,我认为是一样的:1)当您单击输入空格时,单击该字形显示,并且2)我无法获得今天高手工作。



我99%肯定是jQuery调用是错误的。我已经尝试了各种各样的方式来按照Sandbox等的方式启动,但是我的JS / jQuery只是不能完成这项工作。



(timepicker()现在没有jQuery启动脚本,工作正常)。



部分问题是,当我从GitHub下载zip时,有两个.less文件(我认为)是Bootstrap2。



任何帮助感激不尽。

 < div class =form-group col-sm -3 colFlushL> 
< label class =control-labelfor =zaq-timeSimple>时间< / label>
< div class =input-group bootstrap-timepicker timepicker colFlush>
< input id =timepicker1type =textname =ass
class =form-control>
< span class =input-group-addon>< i
class =glyphicon glyphicon-time>< / i>< / span>
< / div>
< / div>

< div class =form-group col-sm-3 colFlushid =zaq-startDate>
< label class =control-labelfor =zaq-startDate>开始日期< / label>
< div class =input-group colFlush>
< input type =textclass =form-control datename =datepicker
data-provide =datepicker>
< span class =input-group-addon>< i class =glyphicon glyphicon-th>< / i>< / span>
< / div>
< / div>

这是我的jQuery尝试的最新版本,我95%肯定是可怕的。 >

 < script> 
$('。datepicker.date')。datepicker。(
{
todayHighlight:true
}

< / script>

NB根据phpStorm日期不是我定义的任何地方定义的类,包含.less文件

PS我应该说这个页面上的两个日期选择器是100%通过表单传递日期的值。

解决方案

确定这是一个打字错误(或者更准确地说,新手缺乏jQuery的理解!!)

 code> $('。datepicker.date')。datepicker。(

应该已经

  $('。datepicker.date')。datepicker(

IE我坚持了一个额外的时间(这让我花了两个小时!D'哦!)


Sorry for the jQuery newbness but I am stuck.

I have been trying out the eternicode/bootstrap-datepicker (https://github.com/eternicode/bootstrap-datepicker). I tried out the sandbox (http://eternicode.github.io/bootstrap-datepicker/) and just wanted to use the "Component" version with "Today" highlighted.

I have two problems which I think are the same thing: 1) the date doesn't show up when you click on the glyphicon only when you click in the input space and 2) I cannot get the "Today" highight working.

I am 99% sure it is the jQuery call that is wrong. I have tried all sorts to get it to fire as per Sandbox etc but my JS/jQuery is just not up to the job.

(The timepicker (https://github.com/jdewit/bootstrap-timepicker) works fine without a jQuery launch script for now).

Part of the problem is that when I download a zip from GitHub there are two .less files both of which (I think) are Bootstrap2.

Any help gratefully recieved.

<div class="form-group col-sm-3 colFlushL">
    <label class="control-label" for="zaq-timeSimple">Time</label>
    <div class="input-group bootstrap-timepicker timepicker colFlush ">
        <input id="timepicker1" type="text" name="arse"
               class="form-control">
        <span class="input-group-addon"><i
                class="glyphicon glyphicon-time"></i></span>
    </div>
</div>

<div class="form-group col-sm-3 colFlush"  id="zaq-startDate">
    <label class="control-label" for="zaq-startDate">Start Date</label>
    <div class="input-group colFlush">
        <input type="text" class="form-control date" name="datepicker"
               data-provide="datepicker">
        <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
    </div>
</div>

Here is the latest version of my jQuery attempt which is I am 95% sure horrendous.

<script>
$('.datepicker.date').datepicker.(
    {
        todayHighlight: true
    }
)
</script>

NB According to phpStorm date is NOT a class defined anywhere which I presume includes the .less file

PS I should have said the two date pickers on the page ARE 100% passing the value of the dates through with the form.

解决方案

OK this was a typo (or more accurately newb lack of jQuery understanding!!)

$('.datepicker.date').datepicker.(

should have been

$('.datepicker.date').datepicker(

IE I stuck in an extra period. (And that cost me at least two hours! D'oh!)

这篇关于对于eternicode Bootstap datepicker,无法获取jQuery调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 21:26