I am using infinitescrolling in laravel with pagination. I have 8 records my records limit is 4. Pagination working fine. Pagination link is coming with 2 page(4 *4 pages). But now i want to use infinite scrolling.
For infinite scroll i am using http://ift.tt/1FKorVp
I have included jquery.infinitescroll.min.js in view page. and write script. But by scroll down no any effect comes.
My View page :
<div class="content" id="content">
@foreach($item['hits'] as $key => $data )
@include('general::partials.product-list')
@endforeach
</div>
{!!$item->render()!!}
My script :
<script type="text/javascript" src="{{ asset('/themes/'.Theme::getCurrent().'/js/jquery.infinitescroll.min.js') }}"></script>
<script type="text/javascript">
$(function() {
var loading_options = {
finishedMsg: "<div class='end-msg'>Congratulations! You've reached the end of the internet</div>",
msgText: "<div class='center'>Loading news items...</div>",
img: "/assets/img/ajax-loader.gif"
};
$('#content').infinitescroll({
loading: loading_options,
navSelector: "ul.pagination",
nextSelector: "ul.navigation a:first",
itemSelector: "#content div.cat-item"
});
});
</script>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire