我如何实施和使用eyecon的bootstrap-datepicker? [英] How do I implement and use eyecon's bootstrap-datepicker?

查看:114
本文介绍了我如何实施和使用eyecon的bootstrap-datepicker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我访问了 Eyecon 并下载了日期选择器。我有三个文件夹。 'css','js'和'less'。我已经包含了bootstrap-datepicker.js和最新的jquery.js,并将头文件中的.css链接在一起:

 < !DOCTYPE> 
< html>
< head>
< meta charset =utf-8>
< meta name =viewportcontent =width = device-width,initial-scale = 1.0>
< title>测试< /标题>
< link rel =stylesheettype =text / csshref =../ css / datepicker.css>
< link rel =stylesheettype =text / csshref =../ css / bootstrap.css>
< link rel =stylesheettype =text / csshref =../ css / bootstrap-responsive.css>


< / head>

< body>
< div class =well>
<! - 我应该在哪里输入以及在哪里/如何调用该功能? - >
< / div>

< script type =text / javascriptsrc =../ js / jquery.js>< / script>
< script type =text / javascriptsrc =../ js / bootstrap-datepicker.js>< / script>
< script type =text / javascriptsrc =../ js / bootstrap.js>< / script>
< / body>
< / html>

正如人们所看到的,我已经在使用bootstrap库了,因此也包括了它。



我现在的问题是:我如何实现并调用日期选择器函数?

解决方案

$('element')。datepicker(); 其中元素是一些类,id等等。



http://jsfiddle.net/6kk3k / 1 /



HTML

 < input type =textclass =datepicker> 

jQuery
< 。pre> $( '日期选择器')日期选择器();


I visited Eyecon and downloaded the datepicker. I got three folders. 'css', 'js' and 'less'. I have included the bootstrap-datepicker.js and the latest jquery.js and linked the .css in the head:

<!DOCTYPE>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Test</title>
        <link rel="stylesheet" type="text/css" href="../css/datepicker.css">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="../css/bootstrap-responsive.css">


    </head>

    <body>
        <div class="well">
            <!--What should I enter here and where/how do I call the function?-->
        </div>

        <script type="text/javascript" src="../js/jquery.js"></script>
        <script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
        <script type="text/javascript" src="../js/bootstrap.js"></script>
    </body>
</html>

As one can see, I'm already working with the bootstrap library and have therefore also included that.

My question now is: how do I implement and call the date picker function?

解决方案

$('element').datepicker(); where element is some class, id etc.

http://jsfiddle.net/6kk3k/1/

HTML

<input type="text" class="datepicker">

jQuery

$('.datepicker').datepicker();

这篇关于我如何实施和使用eyecon的bootstrap-datepicker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆