jscroll
jscroll copied to clipboard
jscroll is not a function
I am including jscroll as follows:
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/jquery.jscroll.min.js"></script>
<script>
$(document).ready(function(){
$('.scroll').jscroll({
autoTrigger: true,
loadingHtml: '<img class="center-block" src="/images/loading.gif" alt="Loading..." />',
padding: 0,
nextSelector: '.pagination li.active + li a',
contentSelector: 'div.infinite-scroll',
callback: function() {
$('ul.pagination').remove();
}
});
});
</script>
yet I am getting the error:
jQuery.Deferred exception: $(...).jscroll is not a function TypeError: $(...).jscroll is not a function
it's driving me crazy! any idea what's going on here? I am using it inside a Laravel blade.
Instead of doing ready try: jQuery(function ($) {