gpt4 book ai didi

javascript - 一页上的 Jquery 冲突

转载 作者:行者123 更新时间:2023-12-02 19:05:14 25 4
gpt4 key购买 nike

我在一个页面中遇到了 2 个 javascript 调用的冲突,想知道是否有人能发现如何修复它。

这是 this page here 的 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 调用,第一个调用取消了第二个调用。任何想法都很棒。

最佳答案

您两次包含 jQuery。

删除该行:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>

关于javascript - 一页上的 Jquery 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14370997/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com