成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

MT-Retina.js

XUI / 806人閱讀

摘要:之前月大總管寫的為高分屏提供不同分辨率圖像支持的插件,需求變動(dòng),增加了語言支持。

MT-Retina.js

Github: MT-Retina.js

serve high-resolution images to devices with retina displays.

之前月大總管寫的為高分屏提供不同分辨率圖像支持的插件,需求變動(dòng),增加了語言支持。

Usage add lib & config

  
set tags
img    
add assets
> tree -L 4                                           
.
└── images
    └── test
        ├── en
        │?? ├── [email protected]
        │?? └── [email protected]
        ├── [email protected]
        └── [email protected]

3 directories, 4 files
Config customize

Customize the rules for assets can be found in the retina-config.js .

// define filters
Retina.setFilters({
    "normal": function (url, base, ratio, lang) {

        var result,
            prefix = "",
            pieces = url.split("/");
        
        // Add language support                   
        if (lang) {
            prefix = lang + "/";
        }
  
        var _postfix = pieces[pieces.length - 1].split(".");            

        // Concat File Path String
        pieces[pieces.length - 1] = prefix + _postfix[0] + "@" + ratio.param + "." + _postfix[1];

        result = pieces.join("/");
        
        return result;
    },
    "svg": function (url, base, ratio, lang) {
        return url;
    }
});
modifyRetinaImg()
modifyRetinaImg(target,src);
Retina.retinaUpdate();
About

@Author Max

@Revised Thonatos.Yang

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/86229.html

相關(guān)文章

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<