Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

jquery

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>
like image 877
khurshid Avatar asked Jul 23 '17 08:07

khurshid


1 Answers

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();
});
like image 77
TroySteven Avatar answered Nov 15 '22 12:11

TroySteven