jQuery插件无法正常工作

时间:2014-02-09 08:38:32

标签: javascript jquery twitter-bootstrap jquery-plugins

我现在正在使用bootstrap 3模板编写一个网页。当我在我的页面中包含一个jquery插件(jquery-frontier-calendar)时,我发现它不起作用。我想这个问题是由于javascript库的重叠造成的。

例如,如果我使用下面的代码,日历效果很好但我的页面中的下拉菜单不起作用。

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="image/pageLogo.jpg">
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/homepage/navbar-static-top.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/calendar/frontierCalendar/jquery-frontier-cal-1.3.2.css" />
    <link rel="stylesheet" type="text/css" href="css/calendar/jquery-ui/smoothness/jquery-ui-1.8.1.custom.css" />
    <script type="text/javascript" src="js/calendar/jquery-core/jquery-1.4.2-ie-fix.min.js"></script>
    <script type="text/javascript" src="js/calendar/jquery-ui/smoothness/jquery-ui-1.8.1.custom.min.js"></script>
    <script type="text/javascript" src="js/calendar/lib/jshashtable-2.1.js"></script>
    <script type="text/javascript" src="js/calendar/frontierCalendar/jquery-frontier-cal-1.3.2.min.js"></script>
    <script type="text/javascript" src="js/calendar/calendar.js"></script>
    <script src="js/calendar.js"></script>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>

</head>

下拉菜单

<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">About us<b class="caret"></b></a>
    <ul class="dropdown-menu">
       <li><a href="#">Company information</a></li>
       <li><a href="#">Contact</a></li>
    </ul>
</li>



但是,如果我在代码中添加以下内容,则下拉菜单效果不错,但无法显示日历。

<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>

任何人都可以帮忙解决这个问题?????

1 个答案:

答案 0 :(得分:1)

尝试 - jQuery.noConflict();

检查jQuery website

中的用法