user3615851 user3615851 - 7 months ago 29
Javascript Question

bxSlider does not initialize

I am trying to initialize the jQuery bxSlider but for some reason, even adding the same resources as shown on the website examples I can't intialize the plugin.

$(document).ready(function() {
$('.bxslider').bxSlider({
mode: 'fade',
captions: true
});
});


What am I doing wrong?

JSFiddle: https://jsfiddle.net/rcymj0s0/2/

Answer

Use this cdn path it will work.

$('.bxslider').bxSlider({
  captions: true
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.5/vendor/jquery.easing.1.3.js"></script>

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.5/jquery.bxslider.min.js"></script>

<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.5/jquery.bxslider.min.css">
    
<div id="slider-section">
  <ul class="bxslider">
    <li><img src="http://media.voog.com/0000/0039/0203/photos/icon.png" /></li>
    <li><img src="http://media.voog.com/0000/0039/0203/photos/icon.png" /></li>
  </ul>
</div>