簡體   English   中英

jquery-ias插件不適用於我的網站,加載更多項目無法正常工作

[英]jquery-ias plugin doesnt work with my website, load more items doenst work

我將我的網站設置為:

 <div id="posts" class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            <div class="post post-preview">
                <a href="post.html">
                    <h2 class="post-title">
                        Visualization Data Art
                    </h2>
                    <h3 class="post-subtitle">
                        How to make sense of big data
                    </h3>
                </a>
                <p class="post-meta">Posted by <a href="#">KP</a> on September 24, 2016</p>
            </div>
            <hr>
            <div class="post post-preview">
                <a href="3.html">
                    <h2 class="post-title">
                        About this blog
                    </h2>
                </a>
                <p class="post-meta">Posted by <a href="about.html">KP</a> on September 18, 2016</p>
            </div>
            <hr>
        </div>
         <div id="pagination">
            <a href="2.html">1</a>
            <a href="3.html" class="next">2</a>
        </div>

和我的JavaScript是這樣的:

 var ias = jQuery.ias({ container:  '#posts', item: '.post', pagination: '#pagination', next:'.next ' });

當我嘗試加載更多內容時,“舊帖子”按鈕消失而沒有顯示任何頁面。 我只嘗試在網站上找到基本示例。

分頁對我來說似乎是錯誤的。 這是docs Infinite AJAX滾動文檔,因為您可以在代碼中的“ li”標簽和“ a”標簽上使用“ .next”而不是“ li”鏈接。 我認為該插件的工作方式是在標簽上查找href,然后用ajax調用並獲取其內容,然后追加到容器DOM中。

<ul id="pagination" class="pager">
            <li class="next">
                <a href="2.html">1</a>
                <a class="next" href="2.html">Older Posts &rarr;</a>
                <a href="2.html">3</a>
            </li>
        </ul>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM