khurshid
khurshid

Reputation: 71

Flexslider 2 is not working with latest jquery 3.2.1 using $(window).load()

enter image description here

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"
  integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  crossorigin="anonymous"></script>

Upvotes: 6

Views: 3260

Answers (1)

TroySteven
TroySteven

Reputation: 5157

The .load event was removed from jQuery 3 so you need to change the .load event to use the "on" function in jQuery. See see the following example code initializing a flex slider instance in jQuery 3.

Original Code:

$(window).load(function() {
    $('.flexslider').flexslider();
});

Updated Code modified to use the on function in jQuery:

$(window).on("load", function() {
    $('.flexslider').flexslider();
});

Upvotes: 14

Related Questions