首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Datepicker不起作用?

问为什么Datepicker不起作用?
EN

Stack Overflow用户
提问于 2011-02-16 23:39:19
回答 3查看 2.1K关注 0票数 1

全,

我有这个页面,

代码语言:javascript
复制
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="priceLists.aspx.cs" Inherits="PriceWorx.priceLists" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css"
        rel="stylesheet" type="text/css" />
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/blitzer/jquery-ui.css"
        rel="Stylesheet" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.js" type="text/javascript"></script>
    <script type="text/javascript">


        $(function () {
            $("#tabs").tabs({ collapsible: true });

            $("#tabs").tabs({ event: "mouseover" });     
            $('#datepicker').datepicker({
                minDate: "0",
                changeMonth: true,
                changeYear: true

            });

        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <!-- all tabs -->
    <div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
        <!-- tab definitions -->
        <ul>
            <li><a href="#tabs-1" class="dynamic">foo</a></li>
            <li><a href="#tabs-2">bar</a></li>
        </ul>
        <div id="tabs-1" style="width: 100%;">
            <div>
                <p>
                    Date:
                    <input type="text" id="datepicker" /></p>
            </div>
        </div>
        <div id="tabs-2">
            <table style="width: 100%;">
                <tr valign="top" align="center">
                    <td style="width: 100%;" colspan="4">
                        bar
                    </td>
                </tr>
            </table>
        </div>
    </div> 
    </form>
</body>
</html>

Tabing工作正常,但Datepicker无法正常工作

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-02-16 23:51:31

jQuery UI的当前版本为1.8.9。只需更改这一行:

代码语言:javascript
复制
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js" type="text/javascript"></script>

在这里工作:http://jsfiddle.net/9XC67/

票数 2
EN

Stack Overflow用户

发布于 2011-02-16 23:43:19

没有足够的信息来了解为什么这是损坏的。我可以告诉你我是如何调试的..

  • 打开firebug控制台。是否有任何错误?使用firebug的
  • 查看body标记的底部,看看那里是否存在数据选择器隐藏的div。
  • 如果该div存在,则使用firebug set display阻止隐藏。你看到日期选择器了吗?切换到不同的选项卡并尝试此过程。
  • 可能是日期选择器在后面,隐藏firebug中的所有选项卡并使日期选择器可见
票数 2
EN

Stack Overflow用户

发布于 2011-02-16 23:50:16

你脑海中的这条线有问题。去掉它,它看起来是有效的。

代码语言:javascript
复制
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" 
  rel="stylesheet" type="text/css" />

你拉错了css。把它改成1.8.0主题就行了。

​

或者,您可以像Shane指出的那样更改javascript引用。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5018457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档