導航:首頁 > 文件教程 > infinitescroll教程

infinitescroll教程

發布時間:2025-07-28 23:01:43

1. 瀑布流布局jquery特效代碼怎麼用

樓主您好

  1. 引入infinitescroll

  2. 頁面元素

    <div data-am-widget="list_news" class="am-list-news am-list-news-default" style="margin:0px 10px 0px 10px;">
    <!--列表標題-->
    <div class="am-list-news-bd">
    <ul class="am-list block" id="container"></ul>
    </div>
    </div>

    <div class="loading" style="text-align:center;">
    </div>

    <div id="navigation">
    <a></a>
    </div>

  3. 初始化

    var navigationUrl = "xxxx?pageNo=1";
    $("#navigation a").attr("href", navigationUrl);
    $.ajax({
    url: 'xxxx',
    type: 'post',
    dataType:'json',
    success: function(items) {
    var html = successCallBack(items);//渲染每一個瀑布流塊
    $('#container').html(html);
    },
    error: function() {
    alert('載入失敗');
    }
    });

  4. 初始化方法調用

    $('#container').infinitescroll({
    navSelector : "#navigation", //導航的選擇器,會被隱藏
    nextSelector : "#navigation a", //包含下一頁鏈接的選擇器
    itemSelector : ".block", //你將要取回的選項(內容塊)
    debug : true, //啟用調試信息
    animate : true, //當有新數據載入進來的時候,頁面是否有動畫效果,默認沒有
    extraScrollPx : 150, //滾動條距離底部多少像素的時候開始載入,默認150
    bufferPx : 40, //載入信息的顯示時間,時間越大,載入信息顯示時間越短
    errorCallback : function() {
    //alert('error');
    }, //當出錯的時候,比如404頁面的時候執行的函數
    localMode : true, //是否允許載入具有相同函數的頁面,默認為false
    dataType : 'json',//可以是json
    template: function(items) {
    itemsTemp = items;
    return successCallBack(items);
    },
    loading : {
    img: '${ctx}/images/loading.gif',
    msgText : "載入中...",
    finishedMsg : '沒有新數據了...',
    selector : '.loading' // 顯示loading信息的div
    }
    }, function() {

    });

閱讀全文

與infinitescroll教程相關的資料

熱點內容
蘋果電腦13寸pro 瀏覽:715
如何在壓縮文件里添加圖片 瀏覽:442
androidintent下載文件 瀏覽:811
win7系統vdi文件下載 瀏覽:199
批量文件路徑列表復制 瀏覽:687
svn增加文件桌面圖標也變了 瀏覽:514
Abb機器人怎麼編程畫圓 瀏覽:958
手機微信接收的文件存儲在哪裡 瀏覽:546
js怎麼給div加邊框顏色 瀏覽:645
nodejshttphtml5 瀏覽:915
如何快速將文件內容快速調整 瀏覽:349
marsandroid開發視頻教程 瀏覽:814
word信任中心 瀏覽:480
pr有哪些預設文件 瀏覽:752
寶馬5系藍牙升級 瀏覽:950
ipad壓縮文件夾不見了 瀏覽:280
蘋果怎麼隱藏軟體視頻文件怎麼打開 瀏覽:541
按一列生成excel新文件 瀏覽:941
word列印機無法列印pdf文件夾 瀏覽:866
4s刷機成功白蘋果之後黑屏 瀏覽:503

友情鏈接