0

我与一页中的 2 个 javascript 调用发生冲突,想知道是否有人能发现如何解决它。

这是此页面的 html :

<!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>
<!--#include virtual="/Assets/Templates/Public/Franchise/HeadCSS.asp"-->

<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- bxSlider Javascript file -->
<script  type="text/javascript" src="/js/bxslider/jquery.bxslider.min.js"></script>
<!-- bxSlider CSS file -->
<link rel="stylesheet" href="/js/bxslider/jquery.bxslider.css" type="text/css" />

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
<link type="text/css" href="/js/pikame/styles/bottom.css" rel="stylesheet" />
<script type="text/javascript" src="/js/pikame/lib/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.pikachoose.js"></script>

</head>
<body id="home">
<!--#include virtual="/Assets/Templates/Public/Franchise/Home.asp"-->

<h1>Latest in Brentwood</h1>
<div>
<ul id="pikame">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /><div style="text-align:center;"><h3>Trees</h3><span style="display:block">Italian</span></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
</ul>
<script>$(function(){ $('#pikame').pikachoose(); });</script>
</div>
<h2>Featured Brentwood Restaurants</h2>
<ul class="bxslider">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /><div style="text-align:center;"><h3>Trees</h3><span style="display:block">Italian</span></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>


<h2>Featured Brentwood Spa and Beauty</h2>
<ul class="bxslider">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>


<h2>Featured Brentwood Shopping</h2>
<ul class="bxslider">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>



<h2>Featured Brentwood Tradesmen</h2>
<ul class="bxslider">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>



<h2>Featured Brentwood Bars and Clubs</h2>
<ul class="bxslider">
  <li><img src="http://bxslider.com/images/170_200/trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/tree_root.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_road.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/me_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/hill_trees.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/mountain.jpg" /></li>
  <li><img src="http://bxslider.com/images/170_200/houses.jpg" /></li>
</ul>

<script type="text/javascript">
  $(document).ready(function(){

$('.bxslider').bxSlider({
  minSlides: 3,
  maxSlides: 4,
  slideWidth: 170,
  slideMargin: 10
});
  });
</script>

<!--#include virtual="/Assets/Templates/Public/Franchise/TemplateEnd.asp"-->
</body>
</html>
<!--#include virtual="/System/Shutdown.asp"-->

如您所见,有 2 个 javascript 调用,第一个正在取消第二个。任何想法都会很棒。

4

2 回答 2

2

您包含 jQuery 两次。

删除行:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
于 2013-01-17T02:00:49.473 回答
0

试试这个 :

<head>
<!--#include virtual="/Assets/Templates/Public/Franchise/HeadCSS.asp"-->

<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.jcarousel.min.js"></script>
<script type="text/javascript" src="/js/pikame/lib/jquery.pikachoose.js"></script>
<!-- bxSlider Javascript file -->
<script  type="text/javascript" src="/js/bxslider/jquery.bxslider.min.js"></script>
<!-- bxSlider CSS file -->
<link rel="stylesheet" href="/js/bxslider/jquery.bxslider.css" type="text/css" />
<link type="text/css" href="/js/pikame/styles/bottom.css" rel="stylesheet" />
</head>
于 2013-01-17T02:48:22.247 回答