Laravel 5无限滚动div

时间:2016-08-23 07:48:56

标签: javascript jquery laravel laravel-5

我是新来的, 有人可以帮我修复这个无法滚动的div不在laravel 5工作吗? 我已经访问了很多链接来解决这个问题,但没有任何帮助..

这是我的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"
    });
}); 

这是在我的刀片上

<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>

谢谢:D

1 个答案:

答案 0 :(得分:0)

保留此代码

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

在这个div里面

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

希望它能奏效。如果没有,请告诉我