layer.js弹窗组件layer.prompt无法调用解决

加载页面加上:

1
2
3
layer.config({ 
    extend: 'extend/layer.ext.js'
});

然后后面执行layer.prompt({})即可,案例:

1
2
3
4
5
6
7
8
9
10
11
12
13
function fun(){
        layer.config({
        extend: 'extend/layer.ext.js'
    });
    layer.prompt({
        title: '输入任何口令,并确认',
        formType: 1 //prompt风格,支持0-2
    }, function(pass){
        layer.prompt({title: '随便写点啥,并确认', formType: 2}, function(text){
            layer.msg('演示完毕!您的口令:'+ pass +' 您最后写下了:'+ text);
        });
    });
}

 

posted @ 2015-07-21 09:36  叨叨的蜗牛  阅读(932)  评论(0编辑  收藏  举报