weibo图床高清图库(原lelouchcrgallery)API


随机获取一张图片API

http://acgart.download/rand



请求方式

GET


可选参数

一个栗子 => 抱枕图

http://acgart.download/rand?ratio=3&range=0.5&source=all

第二个栗子 => 本页背景图 异步加载

背景图css

    
        #bkImg{
            position: fixed;
            right:0;
            top:0;
            // height:100%;
            width:100%;
            opacity:0.20;
            background: no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
            z-index: -999;
        }
    
    

异步加载js

    
        function lgallery(option) {
            console.log(option);
            var bgimg = document.createElement('img');
            //bgimg.setAttribute('src', option.p_mid);
            bgimg.setAttribute('src', option.p_ori);
            bgimg.setAttribute('id', 'bkImg');
            bgimg.setAttribute('onmousedown', 'return false');
            document.body.appendChild(bgimg);
        }

        setTimeout(function() {
            var hjs = document.createElement('script');
            hjs.setAttribute('src', 'http://acgart.download/rand?ratio=0.625&range=0.2&source=all&encode=jsc&func=lgallery');
            document.body.appendChild(hjs);
        }, 0);