我似乎无法使bxSlider正常工作,也找不到原因。
这是我的密码

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Maxime G - Home</title>
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="portfolio ,html, css, c#, wordpress, UK, developer, front-end, back-end, programming, freelancer, freelance, maxime, godrie, maxime godrie, website" />
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/jquery.bxslider.css" />

<script src="/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>

<script src="/js/slider/jquery.bxslider.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
        $('.bxslider').bxSlider();
    });
</script>

<section class="sectionCarouselIndex">
     <ul class="bxslider">
         <li><img src="img/c2c.jpg" /></li>
         <li><img src="img/dcs-full.jpg" /></li>
         <li><img src="img/eding.jpg" /></li>
         <li><img src="img/karim-full.jpg" /></li>
         <li><img src="img/waterside-full.jpg" /></li>
         <li><img src="img/chesil-full.jpg" /></li>
         <li><img src="img/enw-full.jpg"/></li>
         <li><img src="img/drl-full.jpg" /></li>
         <li><img src="img/portal-full.jpg" /></li>
         <li><img src="img/comixology-full.png" /></li>
         <li><img src="img/history-full.jpg" /></li>
         <li><img src="img/parkmap-full.png" /></li>
     </ul>
</section>

这是我在Firefox控制台中遇到的错误:
ReferenceError: jQuery is not defined

[Break On This Error]

$(document).ready(function () {

index.html (line 25)

ReferenceError: $ is not defined
[Break On This Error]

$(document).ready(function () {

如果你想看看,它实际上看起来像是在那里工作,但在我的本地机器上,我无法使这个滑块正常工作。

最佳答案

将jquery min脚本引用放在bxslider.js之前
替换这个

<script src="/js/slider/jquery.bxslider.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="/js/slider/jquery.bxslider.js"></script>

08-15 16:45
查看更多