testMaven/WebRoot/resource/js/layer/extend/layer.ext.js

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*!
 
 @Name: layer v1.9.x-ext
 @Author: 贤心
 @Api:http://sentsin.com/jquery/layer

 */
 
;!function(){
 
layer.use('skin/layer.ext.css', function(){
    layer.layui_layer_extendlayerextjs = true;
});

var cache = layer.cache||{}, skin = function(type){
    return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
}

//仿系统prompt
layer.prompt = function(options, yes){
    options = options || {};
    if(typeof options === 'function') yes = options;
    var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input">'+ (options.value||'') +'</textarea>' : function(){
        return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
    }();
    return layer.open($.extend({
        btn: ['&#x786E;&#x5B9A;','&#x53D6;&#x6D88;'],
        content: content,
        skin: 'layui-layer-prompt' + skin('prompt'),
        success: function(layero){
            prompt = layero.find('.layui-layer-input');
            prompt.focus();
        }, yes: function(index){
            var value = prompt.val();
            if(value === ''){
                prompt.focus();
            } else if(value.length > (options.maxlength||500)) {
                layer.tips('&#x6700;&#x591A;&#x8F93;&#x5165;'+ (options.maxlength || 500) +'&#x4E2A;&#x5B57;&#x6570;', prompt, {tips: 1});
            } else {
                yes && yes(value, index, prompt);
            }
        }
    }, options));
};

//tab层
layer.tab = function(options){
    options = options || {};
    var tab = options.tab || {};
    return layer.open($.extend({
        type: 1,
        skin: 'layui-layer-tab' + skin('tab'),
        title: function(){
            var len = tab.length, ii = 1, str = '';
            if(len > 0){
                str = '<span class="layui-layer-tabnow">'+ tab[0].title +'</span>';
                for(; ii < len; ii++){
                    str += '<span>'+ tab[ii].title +'</span>';
                }
            }
后面还有 200 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。