Ininate Scroll Ebay

enter something useful

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Ininate Scroll Ebay
// @namespace    http://your.homepage/
// @version      0.1
// @description  enter something useful
// @author       You
// @match        http://www.ebay.co.uk/sch/*
// @grant        none
// @locale       en
// ==/UserScript==



$.getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js', function() {

    $.getScript('https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js', function() {
        $('#GalleryViewInner').infinitescroll({
            dataType: 'html',
            navSelector  : "#PaginationAndExpansionsContainer",            
            // selector for the paged navigation (it will be hidden)
            nextSelector : ".next",    
            // selector for the NEXT link (to page 2)
            itemSelector : "#GalleryViewInner"          
            // selector for all items you'll retrieve
        },function(arrayOfNewElems){
            $('.null').each(function(item, thing){
                var myself = $(this),
                    image = myself.find('img'),
                    imageTag = image.attr('imgurl');

                myself.removeClass('null');
                image.attr('src',imageTag);
            });
            // optional callback when new content is successfully loaded in.

            // keyword `this` will refer to the new DOM content that was just added.
            // as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
            //                   all the new elements that were found are passed in as an array

        });          
    });
});