简体   繁体   中英

Laravel 5 infinity scroll div

Im new here, can someone help me fix this infinite scroll for div not working in laravel 5 ? i already visit alot link to solve this, but nothing help..

This is my javascript

$(document).ready(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: "/js/ajax-loader.gif"
    };

    $('#content').infinitescroll({
        loading: loading_options,
        navSelector: "ul.pagination",
        nextSelector: "ul.navigation a:first",
        itemSelector: "#content div.cat-item"
    });
}); 

and this is on my blade

<div class="col-sm-8 single-left" id="content">
    @foreach ($all as $image) 
    <div class="song" >
        <div class="song-info">
            <h3>{{$image->judul}}</h3>  
        </div>
        <div class="singleimage" >
            <img src="/file/meme/{{ $image->gambar }}" alt="" />
        </div>
    </div>

    <div class="song-grid-right">
        <div class="share">
            <h5><div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button" data-size="large" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/wahyu.p.putra.10"></a></div></h5>
            <ul>
                <li><a href="/Meme/{{ $image->url }}/{{ $image->url2 }}" class="icon like">{{$image->likes}} Likes</a></li>
                <li><a href="#" id="commenttombol" class="icon comment-icon">Comments</a></li>
                <li class="view">{{$image->view}}</li>
            </ul>
        </div>
    </div>
    @endforeach 
</div>

<div id="pagination">
    {!! $all->render()!!}
</div>

Thanks :D

Keep this code

<div id="pagination">
   {!! $all->render()!!}
</div>

Inside this div

<div class="col-sm-8 single-left" id="content">

Hopefully it will work . If not please let me know

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM